Convert ESP based airco controller to ESPhome : possible?

Last week I was playing around with the following project to control my Mitsubishi Heavy Industries airconditioning units:
absalom-muc/MHI-AC-Ctrl: Reads and writes data (e.g. power, mode, fan status etc.) from/to a Mitsubishi Heavy Industries (MHI) air conditioner (AC) via SPI controlled by MQTT (github.com)

It works as supposed, but since my current HA did not use any MQTT before this project, I am wondering if this project can be migrated/converted to ESPHome for native HA support.

The problem is that I am not a programmer, so I have no clue if what I want is even possible. Is there someone who can take a (quick) peek at the project above and tell me if it is possible and how many free days I need to sacrifice to convert it to ESPHome? :slight_smile:

MQTT is pretty easy to set up.

MQTT is the part I would like to skip in the new config, it is the part where the communication with the airco takes place which probably is the hardest to migrate, if even possible.

It will almost certainly be a lot quicker and more robust to install an MQTT broker (Mosquitto).

That is something to find out, but I will test and compare when possible.
The main question is not the MQTT part, because that part should be easy in ESPHome.

The part of the custom created software SPI instructions from absalom-muc/MHI-AC-Ctrl: Reads and writes data (e.g. power, mode, fan status etc.) from/to a Mitsubishi Heavy Industries (MHI) air conditioner (AC) via SPI controlled by MQTT (github.com) , is the part for which I am wondering if it is possible to migrate to ESPHome.

You are not listening to what we are saying. There is no need to port this to ESPhome when your existing application works well with mqtt. There is little to no advantage in doing this.

With all due respect, you are not listening to what I am saying either. I am not asking to the advantage of using MQTT or the way it is working now, I am asking is someone who knows a little code can take a look at the code of the project (especially the custom part) to see if it is even possible to migrate to ESPHome.

It sure is possible. Most not too complex Arduino sketches map quite nice to a ESPHome (Custom)Component. They also have loop() and setup().

But: The SPI api to the air conditioning interface seems quite complex. You might get lucky and it will just work when you build it into a custom component or something breaks (they are using interupts) and you have to investigate.

If you were a programmer with some Arduino or ESPHome experience I would say one or two longer evenings but without any programming experience you got yourself a nice big learning project.

If i were you I would just use the code from the git hub project and connect it to HA using MQTT.

Maybe you can contact rene-klootwijk/sergiy -dudanov (working on midea-ac esphome)
I know they are on Telegram, just can’t find the url :thinking:

I think MHI-AC-Ctrl-ESPHome is something like that. I’m a beginner with ESPHome, how can I get these filest to ESPHome?

edit: Looks like it’s quite easy. Just copy the files to \config\esphome folder and press install to generate the bin file to flash the Wemos D1 mini.

1 Like

That version works perfect!

Yep, it works great.

Does anyone know, can you ‘take out’ from the three dot menu in thermostat card fan modes and swing modes? I would like to adjust fan speed directly, don’t like this additional step.

I think you can use the climate mode entity row from HACS for it:

In my dashboard, I am using it for 3 shortcuts for a heating preset, cooling preset and off. According to the github page, you can also manipulate fan speed and swing mode.

1 Like

Thanks! Found another one here: Lovelace: Simple thermostat card

esphome can be run as standalone device with its own webinterface?

Yes,

Isn’t this an advantage over MQTT alone?

As Tom said, if your current AC supports MQTT, there is little to gain from using ESPHome…
(My AC only works with ESPHome, and did not support MQTT…)

personally, I have found esphome to be a more reliable and consistent connection besides providing a “backup” solution.