Midea branded AC’s with ESPhome (no cloud)

in mean time you can check mine: my github


it’s dirty and work in progress but functional, you may get some inspiration where to go next.
I didn’t care for zone2 yet as not using it

Also wating for @Mosibi config as I couldn’t progress without his help

1 Like

Hi Tomasz_p, when you say you’ve used D5 and D6 on the ESP are you refering to RX/TX0 ?

I’m using an ESP32 Dev Board and like yourself, just cannot get any comms working to the heatpump controller.

I’m currently using TX/RX1 set which should be GPIO 16,17. I have set the heatpump modbus device ID on the dial to 1, which should set it as device 1.
However im simply getting the same replies as you were via esphome, no response received.

Any ideas?

Is that this dial you are talking about?

As you can see, mine is set to 0 but I use 1 (0x1) as address. That surprised me a bit, I expected I had to use address 16 (according the docs). So my advice, try all the 16 addresses

i got it working the same way, just had to not use the normal uart pins. Odd, thanks for the insight though!
All up and running now, on my way adding a few more of the holding registers for switches etc

Hi all,

A week ago I made a post in this topic to let you know that I have a pretty okay working config for the Midea heat pump (and clones). A few of you helped me with advise on some settings and now I think it is time to share it with you all.

The project can be found here: GitHub - Mosibi/Midea-heat-pump-ESPHome

I you have suggestions, feedback or something else, then please let me know. And of course, pull requests on the config are very welcome!! :smiley:

2 Likes

I have an EMI I-verter mini split I-Verter Variable Speed Single Zone Ductless Split Systems | EMI RetroAire which is similar to Midea.

The display board has an empty area labeled wifi CN3. At first I thought this was the UART port but after soldering pins and connecting an esp8266 it would respond with exactly the same message being sent out. It was missing the usb port board so I ordered it, part 17222000A01170. 17222000A01170 Midea Display Box Subassembly

With that usb board I was seeing responces to the UART messages and was able to control temp and power via esphome. But the remote stopped working. Unplugging the usb board allowed the remote to work but it wasn’t working with it connected.

Looking at the boards posted by @nvschilleman (has a usb module) and @bartlebi (no usb module) and the display board I have I noticed that jumper J3 connects XT and REC together on the boards without an extneral usb module and is missing on the board with the module. Also noticed there is a signal on those two pins when the remote is pressed. Lastly @nvschilleman said the unit stops responding if the usb board is disconnected which is the opposite of what’s happening with my setup. So I de-soldered jumper/resistor J3 and it worked! Now I can have the usb board connected and it still responds to the remote and I can control it via esphome as well.

I did have to make a few changes to the MideaUART library used by the midea component because it would request power usage every 30 seconds even if there is no power usage config and in my case that caused the usb module to restart (led starts flashing) and it would lose communication for a few seconds. Also removed the network status reporting that the library did every 2 minutes since that also caused a temporary comm issue. Removed the preset check that stopped it from changing fan speeds if a preset was active because it would go into defrost on its own and that would block fan speed changes. Finally set the fan speeds to 30/50/80 instead of 20/40/60/80 since my unit used those instead.

Anyway, main point is if you have an empty CN3 connector that mentions wifi on it you can probably get the usb board and desolder J3 to make it work.

2 Likes

Display board front

Hi @Mosibi,

I tried to use your code but after successful compilation and upload to the board I cant’ get any logs… I got error saying that there’s no connection via wifi.
Any suggestions?

If you want more logging output then you have now, change “logger.level” from “INFO” to “DEBUG” in heatpump.yaml and re-upload it.

And for your wifi, instead of using a secret file, you can directly place your ssid and password in there to see if that helps. It should open a fallback access point btw when the wifi client setup fails, the ssid and password for it are in the config file.

I don’t know the reason because my normal setup is working and using secrets - I didn’t change that.
Got it working now but i had to cut registers from number 200, as a matter of fact I dont need them.

But instead I’d like to use register 0 to choose from water temp flow control (bit 1) and room temp thermostat control (bit 0). Could you provide some clues?

Hi,

Took me a long time to figure things out.
For Vaillant Arovair, Bulex Genia Fan, Saunier Duval Genia Fan, Midea MKG series, and other Midea clones:
Old versions can be controller via Modbus with the PQE connection.
Newer ones (like mine) doesnt have the Modbus hardware anymore:

Only the XYE connection:
Via reverse engineering i can succesfull operate 5 units via XYE and RS 485 in a Loxone system.

XYE is basically an RS485 network:

I made an excel file to generate the 16 byte string for communication.
and also how to enter this into a Loxone RS485 system.

Unfortunately I’m not allowed to share excel files on this forum

Regards

Lieven

@tomasz_p

What you need for register 0, bit 0 and 1, is a “switch”. I just did that for bit 2 in my config and this change should make it clear for you what changes are needed.

See Added switch for register 0 bit 2 · Mosibi/Midea-heat-pump-ESPHome@51cc7f7 · GitHub for the change I made.

Regarding your other issue. If it works without the registers from the 200 range, i suspect it has something to do with the amount of storage available on your ESP32, but still it is strange that the compile phase went okay.

@Mosibi I know that this should be switch and that’s what i have set, but it doesn’t work properly. Especially the room thermostat control switch. When I turn it on it stays for a couple of seconds and goes back off.
I wonder if it should be in a similar way to your config of Register 7, to read the state of it and then make a change. I tried this way but results where the same as I remember, although I don’t know if the code I made was right in this case.

Could you check on your side?

My advise with these settings, is to try it first on the unit it self and see what happens when you change it. If I do that, then I get a message that I am not able to change that value, since the unit is controlled by a thermostat.

I assume your situation could be the same, so if you really want to change that value, you first have to configure others. That is the reason btw why I do not have those (yet) in my config

1 Like

There’s some small progress, kinda…
@Mosibi I took your advise and first checked the states after changing functions on the controller.
I’ve found that the register which indicates the room thermostat control enabled is 210 bit 4, but there is no one that indicates water flow control enabled. So I made a “switch” for it. But after use it makes strange behaviour: it’s disabling DHW function and sets double zone, where the first is controlled by water flow and the second by room thermostat.
So it looks like it has an impact on several or maybe even all bits of this register. I think it’s partialy related to the fact that the water flow is the default setting and without turning it off when I want to set the room thermostat control on it also by default sets the double zone. That is also noticable when settings are made on the controller itself. But the problem is I can’t find register that confirms the water flow control enabled. It’s none of the register 210 bits 1 - 4 for sure. The other thing is that on the controller these settings are first all set and then saved. So I think that via modbus these settings (water flow off and room thermostat on) has to be made with one command (to be at the same time).

BTW. Do you have a better modbus register list than the Clivet one? In my opinion it has some mistakes and misaleading descriptions.

I have a Airwell heatpump myself, so I use the documentation from that one as my primary source and next to it, I use the docs from Midea to fill in where the Airwell register list is lacking or wrong.

I’ve some problem with IR transmitter and I’m little frustrated. I have a dongle with ESPhome and everithing work fine. I want to add the display toggle that work trough IR.
After soldered the IR led and everithing work fine. The display is going ON and OFF so the IR work correctly.

But when I close the lid of the AC unit the display won’t goes OFF or ON anymore. I open again the lid and everithing work fine.

Some idea of what’s happening?

Hi all!

I got a MAW08V1QWT, had dudanov’s dongle pcb made with JLCPCB, and it works great with h-a! The only exception is turning on eco mode via the h-a mode selector seems to not work.

I was wondering if anyone else had data on this device’s full featureset, particularly if it supports FollowMe, before I take apart the front panel or add an IR emitter. I see the remote has a thermistor, but I can’t find any information on how it’s used.

From what I’ve been able to gather, the remote measures temperature and then transmits it via IR, and the follow me via dongle requires an IR blaster, you can’t communicate it over serial, but I don’t know for sure.

Can you advise me how to implement your code directly into Home assistant? I have a converter to Eth, I can view sensor states. And I am not able to implement the whole heatpump.yaml without using ESP32.

Thank You, Radek