This repository provides an ESPHome external component and a Home Assistant custom component for controlling Mitsubishi heat pumps via the CN105 serial interface. The core component implements a full climate controller with dual setpoint support, multiple operating modes (heat, cool, heat_cool, dry, fan_only), fan speeds, swing modes, remote temperature integration, and a wide array of sensors (compressor frequency, power, kWh, outside temperature, error codes, etc.). It communicates with the heat pump over UART at 2400 baud using a reverse-engineered protocol with checksum validation and cyclic request scheduling. The Home Assistant proxy component dynamically adjusts the UI to show single or dual setpoint sliders based on the active mode, fixes Auto mode behavior, and supports advanced features like coordinator single-target mode for multi-zone systems. The codebase is well-structured with standalone reusable modules for frame parsing, protocol encoding/decoding, request scheduling, and temperature conversion, supported by a comprehensive unit test suite and CI pipeline. The repository includes example configurations for various microcontrollers (ESP32, Xiao, M5Stack) and deployment scenarios, making it a mature and practical solution for integrating Mitsubishi heat pumps into smart home systems.
This repository provides firmware for ESP8266/ESP32 microcontrollers to interface Mitsubishi Heat Pumps (HVAC units) with MQTT and Home Assistant. The firmware runs on the ESP board, which connects to the heat pump's serial interface using the SwiCago/HeatPump library, and exposes a web interface for configuration and control, as well as MQTT topics for integration with smart home systems. It supports Home Assistant MQTT auto-discovery, Prometheus metrics, OTA firmware updates, and multi-language web UI. The architecture is a monolithic Arduino sketch with separate header files for configuration, HTML templates, JavaScript, and language strings. Key entry points are the setup() and loop() functions in mitsubishi2mqtt.ino, which initialize WiFi, MQTT, the heat pump connection, and a web server. Data flows: the ESP reads heat pump status via serial, publishes state to MQTT, subscribes to command topics, and serves a web control panel. External dependencies include the HeatPump library, ArduinoJson, PubSubClient, and the ESP8266/ESP32 Arduino core.