floatplane / MitsuQTT

Use ESP8266/ESP32 hardware to control Mitsubishi heat pumps via MQTT
GNU Lesser General Public License v2.1
3 stars 2 forks source link
esp32 esp8266 mitsubishi mqtt platformio

MitsuQTT

pronounced Mitsu-cute

.github/workflows/build.yml .github/workflows/test.yml .github/workflows/static_analysis.yml .github/workflows/clangformat.yml BuyMeACoffee

MitsuQTT is an embedded application that runs on ESP8266/ESP32 hardware and provides the following functionality:

MitsuQTT is a drop-in replacement for the mitsubishi2MQTT project, with some notable improvements:

Screenshots

homepage control status page light mode
home page control status light mode

Setup

Hardware

You're going to need to get some hardware connected to your heat pump. Here are some links I found helpful:

Initial software setup

This project uses PlatformIO to build. Recommmended: install the PlatformIO IDE through VS Code. From VS Code, it should be one button press to build and deploy to your selected hardware:

https://github.com/floatplane/MitsuQTT/assets/101196/1e14b3e7-e1f5-4804-876f-b56db5232b45

You should only have to build and deploy the code once onto your hardware - subsequent updates can be done over-the-air (OTA).

Configuration

If all goes well, the WiFi hardware will create its own ad-hoc network that you can join. Look for an access point of the form HVAC_XXXX and connect to it. Then visit http://192.168.1.1 or http://setup to get to the initial configuration screen. Here, you'll enter a name for your hardware (use a hostname - no spaces!) as well as login information for the wireless network you want the hardware to connect to.

After saving and restarting, you'll be ready to configure your hardware through the Setup screen - in particular, you'll want to set up an MQTT connection to use this with Home Assistant, Node-RED, or any other automation technology.

OTA updates

You can download the latest versions here. Pick the download for your hardware type, unzip it on your desktop, and use the "Firmware Update" page to upload the BIN file to your hardware.

Should I use a SPIFFS or LittleFS version?

There are two incompatible filesystems for ESP8266/ESP32 - LittleFS and SPIFFS. LittleFS is the more modern filesystem and should be used by default. SPIFFS is supported for backwards compatibility when upgrading from older versions, but support will be removed at some point. If you know you need SPIFFS, use a firmware version with SPIFFS in the name. Don't worry, the upload page will try to warn you if you've picked incorrectly!


Monitoring

MitsuQTT exposes a /metrics.json endpoint that can be used to directly interrogate the state of the hardware. You can connect this to a tool like Uptime Kuma to watch for changes and publish alerts:

image

Safe mode

Safe mode is for air handlers: units that are designed to be replacements for legacy furnaces. Air handlers typically rely on getting a current temperature reading from a remote thermostat, since the ambient temperature they read in a basement can be wildly different from the temperature in the living space. If a connection failure prevents MitsuQTT from receiving remote temperature updates, the default behavior is to revert to the internal temperature sensor - fine for wall-mounted indoor units, but disastrous for air handlers that believe that the room temperature has dropped by 10 degrees, and start heating to compensate.

MitsuQTT offers a "safe mode" option, which will shut the air handler down when remote temperature signals are not being received, and turn it back on when they resume. Safe mode activation can be observed through /metrics.json, and thus turned into an actionable alert:

$ curl http://main_floor_heatpump/metrics.json
{
  "hostname": "main_floor_heatpump",
  "version": "2024.03.17",
  "git_hash": "3daa0ce",
  "status": {
    // If `true`, then safe mode has been activated and the heat pump
    // will ignore all MQTT requests to turn on
    "safeModeLockout": false
  },
  // ...
}

Node-RED control

You can post messages to MQTT to control the heat pump:

Grafana dashboard

note: this was copied from Mitsubishi2MQTT, but is not well tested. file an issue if you have problems!

To use Grafana you need to have Prometheus and Grafana (v10 or newer) installed. Config for Prometheus:

    static_configs:
        - targets:
            - IP-TO-MitsuQTT

Then add Prometheus as a datasource in Grafana Grafana -> Connections -> Add new connection -> Prometheus -> Prometheus server URL: PROMETHEUS-IP:PORT

Then you can import the dashboard in Grafana -> Dashboards -> New -> Import and upload the file https://github.com/floatplane/MitsuQTT/blob/master/misc/prometheus.json

Credits

MitsuQTT started as a fork of gysmo38/mitsubishi2MQTT, though it's evolved quite a bit since then.

Heat pump control is via SwiCago/HeatPump.

Support

I hope this is useful to you! If it is, then maybe you'd like to buy me a coffee? :blush:

Buy Me A Coffee