Skip to content

About

Home Assistant custom integration for Mitsubishi Electric heat pumps via Tasmota's MiElHVAC driver running on ESP32/ESP8266

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

113 Commits

Folders and files

Repository files navigation

Tasmota MiElHVAC Integration for Home Assistant

Works with Home Assistant hacs_badge Platform Tasmota Latest Version License: MIT

Home Assistant integration for Mitsubishi Electric heat pumps controlled by Tasmota's MiElHVAC driver.

This integration automatically discovers and creates climate entities for your HVAC devices, seamlessly linking them to your existing Tasmota devices.

Features

  • 🔍 Automatic Discovery - Detects MiElHVAC devices via MQTT automatically
  • 🔗 Device Linking - Climate entities appear under your Tasmota devices
  • 🌡️ Full Climate Control - Temperature, modes, fan speed, and swing control
  • 🏠 Local Control - All communication via local MQTT (no cloud required)
  • 🔄 State Persistence - Remembers settings after Home Assistant restarts
  • 🌍 Multi-language - English and French UI translations included
  • ⚡ Energy Monitoring - Real-time power (W) and cumulative energy (kWh)
  • 🌬️ Extended Controls - Purifier, Night Mode, EconoCool, i-See Air Direction
  • 🌡️ Remote Temperature - Send an external temperature sensor reading to the unit
  • 📊 Capability Awareness - Exposes unit capabilities reported by the driver
  • ↔️ Backward Compatible - Works with both legacy and new Tasmota MiElHVAC driver

Supported Features

HVAC Modes

  • Off
  • Auto
  • Cool
  • Dry
  • Heat
  • Fan Only

Fan Speeds

  • Auto
  • Quiet
  • Speed 1–4

Swing Control

  • Vertical: Auto, Up, Up-Middle, Center, Down-Middle, Down, Swing
  • Horizontal: Auto, Left, Left-Middle, Center, Right-Middle, Right, Swing

Temperature Control

  • Range: 10°C – 31°C (may be narrowed by unit capabilities)
  • Precision: 0.5°C steps

Extended Controls (new driver, post-PR#24660)

These features are exposed as state attributes and callable via Home Assistant services. They are only available when your Tasmota firmware reports the corresponding capability (cap_run_state=true):

Feature Attribute Notes
Purifier purifier on / off
Night Mode night_mode on / off
EconoCool econo_cool on / off — COOL mode only
i-See Air Direction air_direction auto, swing, even, direct
Remote Temperature remote_temperature Send external temp to unit (°C)

Energy Monitoring (new driver, post-PR#24486)

Attribute Unit Description
power_usage_w W Instantaneous power consumption
energy_total_kwh kWh Cumulative energy total

Additional Attributes

Attribute Description
swing_horizontal Current horizontal swing position
outdoor_temperature Outdoor temperature reported by unit (if supported)
capabilities Map of *Supported flags from the driver

Prerequisites

Hardware

  • ESP32 or ESP8266 device running Tasmota
  • Mitsubishi Electric heat pump with CN105 connector
  • JST PA 5-pin connector (2.0mm pitch) to interface with CN105

For complete hardware setup including wiring diagrams and CN105 pinout, see:

Software

  • Home Assistant 2023.1 or newer
  • Tasmota firmware with MiElHVAC driver enabled
  • MQTT broker (e.g., Mosquitto) configured in Home Assistant

Note: This Home Assistant integration works with both ESP32 and ESP8266. The MiElHVAC Display Driver (Berry-based web UI) requires ESP32 only, but is optional.

Tasmota Driver Compatibility

This integration is compatible with all versions of the Tasmota MiElHVAC driver:

Driver version SENSOR field HVACSETTINGS field Supported
Pre-PR#24486 (legacy) Temperature Temp ✅
Post-PR#24490 RoomTemperature SetTemperature ✅
Post-PR#24517 + RemoteTemperature — ✅
Post-PR#24660 + OutdoorTemperature, energy, capabilities + Purifier, NightMode, EconoCool ✅

Tasmota Configuration

Your Tasmota device must:

  1. Have MiElHVAC driver active

    • The driver should publish HVAC data to tele/{topic}/SENSOR
  2. Be connected to your MQTT broker

    • Same broker as Home Assistant
  3. Have discovery enabled (recommended)

    SetOption19 0
    
  4. Have a configured Device Name

    • Set in Tasmota: Configuration → Configure Other → Device Name
    • Example: "Living Room AC" or "Bedroom HVAC"

Installation

HACS (Recommended)

  1. Open HACS in Home Assistant
  2. Click on Integrations
  3. Click the three dots menu (top right) → Custom repositories
  4. Add repository:
    • URL: https://github.com/aldweb/ha-tasmota-mielhvac
    • Category: Integration
  5. Click Add
  6. Search for "Tasmota MiElHVAC" in HACS
  7. Click Download
  8. Restart Home Assistant

Manual Installation

  1. Download the latest release from GitHub
  2. Extract the tasmota_mielhvac folder
  3. Copy it to your Home Assistant custom_components directory:
    config/
    └── custom_components/
        └── tasmota_mielhvac/
    
  4. Restart Home Assistant

Configuration

1. Add the Integration

  1. Go to Settings → Devices & Services
  2. Click + Add Integration
  3. Search for "Tasmota MiElHVAC"
  4. Click on it and follow the setup dialog
  5. Click Submit

That's it! No configuration needed - the integration will automatically discover your devices.

2. Verify Discovery

Check the logs to confirm your devices were discovered:

Settings → System → Logs

Look for messages like:

Discovered MiElHVAC device: tasmota_hvac (RoomTemp: 21.5°C) - Living Room AC

3. Check Your Devices

Go to Settings → Devices & Services → MQTT

Your Tasmota devices should now have a climate entity (HVAC) alongside their other entities.

Usage

Basic Control

Once discovered, you can control your HVAC through:

  1. Lovelace UI - Use the standard Thermostat card
  2. Home Assistant App - Full mobile control
  3. Automations - Create climate-based automations
  4. Voice Assistants - Control via Alexa, Google Assistant, etc.

Extended Controls via Services

Features like Purifier, Night Mode, EconoCool, Air Direction, and Remote Temperature are not yet exposed as native HA climate controls, but can be triggered via the mqtt.publish service or automations.

Set Remote Temperature

Send an external temperature reading to the HVAC unit (replaces the unit's built-in sensor):

service: mqtt.publish
data:
  topic: cmnd/your_topic/HVACSetRemoteTemp
  payload: "21.5"

To clear the remote temperature and revert to the unit's own sensor:

service: mqtt.publish
data:
  topic: cmnd/your_topic/HVACSetRemoteTempClearTime
  payload: "0"

Enable Purifier

service: mqtt.publish
data:
  topic: cmnd/your_topic/HVACSetPurify
  payload: "on"

Enable Night Mode

service: mqtt.publish
data:
  topic: cmnd/your_topic/HVACSetNightMode
  payload: "on"

Enable EconoCool (COOL mode only)

service: mqtt.publish
data:
  topic: cmnd/your_topic/HVACSetEconoCool
  payload: "on"

Set i-See Air Direction

service: mqtt.publish
data:
  topic: cmnd/your_topic/HVACSetAirDirection
  payload: "swing"   # auto | swing | even | direct

Set Horizontal Swing

service: mqtt.publish
data:
  topic: cmnd/your_topic/HVACSetSwingH
  payload: "swing"   # auto | left | left_middle | center | right_middle | right | swing

Automation Examples

Sync indoor temperature from another sensor

automation:
  - alias: "Send remote temperature to HVAC"
    trigger:
      - platform: state
        entity_id: sensor.living_room_temperature
    action:
      - service: mqtt.publish
        data:
          topic: cmnd/living_room_hvac/HVACSetRemoteTemp
          payload: "{{ states('sensor.living_room_temperature') }}"

Enable Night Mode at bedtime

automation:
  - alias: "HVAC Night Mode"
    trigger:
      - platform: time
        at: "22:30:00"
    action:
      - service: mqtt.publish
        data:
          topic: cmnd/bedroom_hvac/HVACSetNightMode
          payload: "on"

MQTT Topics

Subscribed Topics (Listening)

Topic Purpose
tele/{topic}/SENSOR Room temp, outdoor temp, energy, capabilities
tele/{topic}/HVACSETTINGS HVAC state (mode, target temp, fan, swing, run-state features)
tele/{topic}/LWT Device availability (Online/Offline)
tasmota/discovery/+/config Tasmota device discovery (for MAC and name)

Published Topics (Commands)

Topic Purpose Example Payload
cmnd/{topic}/HVACSetHAMode Set HVAC mode heat, cool, auto, off
cmnd/{topic}/HVACSetTemp Set target temperature 22
cmnd/{topic}/HVACSetFanSpeed Set fan speed auto, quiet, 1–4
cmnd/{topic}/HVACSetSwingV Set vertical swing auto, up, center, down, swing
cmnd/{topic}/HVACSetSwingH Set horizontal swing auto, left, center, right, swing
cmnd/{topic}/HVACSetRemoteTemp Send external temperature 21.5
cmnd/{topic}/HVACSetRemoteTempClearTime Clear remote temp timeout 0
cmnd/{topic}/HVACSetPurify Toggle purifier on, off
cmnd/{topic}/HVACSetNightMode Toggle night mode on, off
cmnd/{topic}/HVACSetEconoCool Toggle EconoCool on, off
cmnd/{topic}/HVACSetAirDirection Set i-See air direction auto, swing, even, direct

Note: HVACSetRemoteTemp and HVACSetRemoteTempClearTime replace the legacy HVACRemoteTemp / HVACRemoteTempClearTime commands from the pre-PR#24496 driver. The new driver (post-PR#24496) uses the HVACSet* prefix for all write commands.

Troubleshooting

Device Not Discovered

Check these items:

  1. MQTT Connection

    • Verify Tasmota is connected to MQTT broker
    • Check MQTT broker logs for messages from your device
  2. MiElHVAC Data

    • Use MQTT Explorer to check if tele/{topic}/SENSOR contains MiElHVAC data
    • The payload should include at least one of: Temperature (legacy) or RoomTemperature (new driver)
  3. Home Assistant Logs

    • Check for discovery messages or errors
    • Look for "Discovered MiElHVAC device" or error messages
  4. Tasmota Device Name

    • Set a unique Device Name in Tasmota configuration
    • Restart Tasmota after changing the name

Extended Features Not Available

Purifier, Night Mode, EconoCool and Air Direction require:

  1. A recent Tasmota build incorporating PR#24660 or later
  2. A unit that supports run-state control (cap_run_state=true in the capabilities attribute)

Check the capabilities attribute of your climate entity to see what your unit supports.

Climate Entity Not Linked to Tasmota Device

This usually happens if Tasmota discovery is disabled.

Solution:

In Tasmota console, run:

SetOption19 0
Restart 1

Commands Not Working

  1. Check MQTT topics in logs

    • Verify commands are being published
  2. Test manually in Tasmota

    • In Tasmota console, try: HVACSetTemp 22
    • If this doesn't work, the issue is with the Tasmota driver, not this integration
  3. Verify device is online

    • Check LWT status in MQTT Explorer: tele/{topic}/LWT should be "Online"

Multiple Entities Created

If you see duplicate climate entities:

  1. Remove all duplicate entities via UI
  2. Restart Home Assistant
  3. The integration will recreate them correctly

Enhanced Web Interface

For an enhanced Tasmota web interface with interactive controls (temperature adjustment, mode/fan/swing selectors), check out the companion Berry driver:

MiElHVAC Tasmota Display Driver

This optional Berry script adds a full-featured web UI directly in your Tasmota interface. Note: Requires ESP32 (Berry scripting not available on ESP8266).

Advanced Configuration

Custom Device Names

Device names come from Tasmota's "Device Name" setting. To customize:

  1. In Tasmota web UI: Configuration → Configure Other
  2. Set Device Name to your preferred name
  3. Restart Tasmota
  4. In Home Assistant, remove and recreate the integration

Using Remote Temperature for Better Accuracy

If your HVAC unit's built-in sensor is inaccurate (common when the unit is behind furniture or in a corner), you can feed it a more accurate external reading via an automation. The driver will use this value instead of its own sensor until the timeout expires.

automation:
  - alias: "Sync external temperature to HVAC"
    trigger:
      - platform: state
        entity_id: sensor.living_room_temp
    action:
      - service: mqtt.publish
        data:
          topic: cmnd/living_room_hvac/HVACSetRemoteTemp
          payload: "{{ states('sensor.living_room_temp') }}"

Technical Details

Architecture

┌─────────────────┐
│  Tasmota Device │
│  (ESP + HVAC)   │
└────────┬────────┘
         │ MQTT
         │
┌────────▼────────────────────┐
│    MQTT Broker              │
│    (Mosquitto)              │
└────────┬────────────────────┘
         │
    ┌────┴────┐
    │         │
┌───▼───┐ ┌──▼──────────────┐
│Tasmota│ │Tasmota MiElHVAC │
│Integr.│ │   Integration   │
└───┬───┘ └──┬──────────────┘
    │        │
    └───┬────┘
        │
┌───────▼──────────┐
│  Home Assistant  │
│  Climate Entity  │
└──────────────────┘

Discovery Flow

  1. Tasmota publishes device info to tasmota/discovery/{MAC}/config
  2. Integration caches device MAC address and name
  3. Tasmota publishes HVAC data to tele/{topic}/SENSOR
  4. Integration detects MiElHVAC data (any of the known field names)
  5. Climate entity is created and linked to Tasmota device via MAC address
  6. Entity appears under the Tasmota device in Home Assistant

Data Flow

Temperature Updates:

  • Tasmota publishes current temp every TelePeriod (default 5 minutes)
  • Integration updates Home Assistant immediately

Commands:

  • User changes setting in Home Assistant
  • Integration publishes MQTT command
  • Tasmota sends command to HVAC
  • Tasmota publishes new state
  • Home Assistant updates entity

Backward Compatibility

The integration handles both legacy and new driver payload formats transparently. Field name changes introduced by the Tasmota driver between 2024 and 2026 are resolved using fallback lookups:

Old field New field Where
Temperature RoomTemperature SENSOR
Power (string) PowerState SENSOR
Temp SetTemperature HVACSETTINGS
HVACRemoteTemp HVACSetRemoteTemp Command
HVACRemoteTempClearTime HVACSetRemoteTempClearTime Command

No configuration change is needed when upgrading your Tasmota firmware.

Support

Documentation

Getting Help

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Credits

Related Projects

Technology

  • Home Assistant - Open source home automation
  • Tasmota - ESP firmware with MiElHVAC driver
  • SwiCago - Original Mitsubishi protocol reverse engineering

Development

  • Created by @aldweb
  • Inspired by the Tasmota and Home Assistant communities

Changelog

Version 2.0.0 (2026-05-01)

Driver compatibility updated to cover all Tasmota MiElHVAC driver changes merged between February and April 2026 (PRs #24486, #24488, #24490, #24496, #24517, #24660). Full backward compatibility with the pre-PR#24486 driver is maintained.

New features:

  • Energy monitoring: power_usage_w and energy_total_kwh state attributes (PR#24486)
  • Extended run-state controls: Purifier, Night Mode, EconoCool, i-See Air Direction (PR#24660)
  • Remote temperature: send an external sensor reading to the HVAC unit (PR#24517)
  • Outdoor temperature attribute (PR#24517 / #24660)
  • Unit capabilities exposed as capabilities attribute (PR#24660)

Breaking changes in Tasmota driver (handled transparently by this integration):

  • HVACSETTINGS.Temp renamed to HVACSETTINGS.SetTemperature (PR#24490)
  • SENSOR.MiElHVAC.Temperature renamed to SENSOR.MiElHVAC.RoomTemperature (PR#24490)
  • SENSOR.MiElHVAC.Power (string) renamed to SENSOR.MiElHVAC.PowerState (PR#24490)
  • HVACRemoteTemp command renamed to HVACSetRemoteTemp (PR#24496)
  • HVACRemoteTempClearTime renamed to HVACSetRemoteTempClearTime (PR#24496)

Version 1.0.0 (2026-02-04)

  • Initial public release
  • Automatic device discovery via Tasmota MQTT discovery
  • Full climate control support
  • Device linking to existing Tasmota devices
  • Multi-language UI (English, French)
  • HACS compatible

Enjoy your automated climate control! 🌡️❄️🔥

About

Home Assistant custom integration for Mitsubishi Electric heat pumps via Tasmota's MiElHVAC driver running on ESP32/ESP8266

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages