Midea branded AC’s with ESPhome (no cloud)

Hi. I was very happy to see this picture, because I have the same situation (and also the same connectors: (A/B/X/Y/E and P/Q/E/H1/H2) I also like to communicate via RS485. I also have the same RS486 USB module as @Mosibi
I prefer to connect this directly to the outdoor unit (same connectors as your photo). Is that possible do you think? And if so, to which of the above should I connect A / B and Ground of my USB converter?

Hi @jack91, unfortunately it never worked for me.
I stayed with the display unit connection as @Mosibi, what more I have built circuit with ESP8266 (wemos D1 mini) and Xy-017 then connected directly to the board power supply of 3.3v which i have found on free CN6 port, then put the module into the display enclousure. Not the best pictures but here is what I did:


working fine for few days now

unfortunately wemos d1 mini is little bit too fat, need to find something thinner to fit under the display cover

1 Like

Thank you for the answer.
I have connected my USB-to-RS485-dongle to XY and I see all kinds of data (see screenshot CoolTerm serial port analyser. ). Is this logical data and can you help me decipher it? Just a good direction :slight_smile:

Hi All!
I also have Midea clone heat pump: Kaisai. I’m struggling to get the modbus working.

I’m getting no response recieved…

[10:35:20][D][modbus_controller:029]: Modbus command to device=1 register=0x6B countdown=0 no response received - removed from send queue
[10:35:22][D][modbus_controller:029]: Modbus command to device=1 register=0x72 countdown=0 no response received - removed from send queue
[10:35:23][D][modbus_controller:029]: Modbus command to device=1 register=0x7A countdown=0 no response received - removed from send queue
[10:35:24][D][modbus_controller:029]: Modbus command to device=1 register=0x88 countdown=0 no response received - removed from send queue
[10:35:26][D][modbus_controller:029]: Modbus command to device=1 register=0x8A countdown=0 no response received - removed from send queue
[10:35:30][D][modbus_controller:029]: Modbus command to device=1 register=0x64 countdown=0 no response received - removed from send queue
[10:35:32][D][modbus_controller:029]: Modbus command to device=1 register=0x66 countdown=0 no response received - removed from send queue
[10:35:33][D][modbus_controller:029]: Modbus command to device=1 register=0x68 countdown=0 no response received - removed from send queue
[10:35:34][D][modbus_controller:029]: Modbus command to device=1 register=0x6B countdown=0 no response received - removed from send queue
[10:35:36][D][modbus_controller:029]: Modbus command to device=1 register=0x72 countdown=0 no response received - removed from send queue
[10:35:37][D][modbus_controller:029]: Modbus command to device=1 register=0x7A countdown=0 no response received - removed from send queue
[10:35:38][D][modbus_controller:029]: Modbus command to device=1 register=0x88 countdown=0 no response received - removed from send queue
[10:35:40][D][modbus_controller:029]: Modbus command to device=1 register=0x8A countdown=0 no response received - removed from send queue
[10:35:41][D][modbus_controller:029]: Modbus command to device=1 register=0x8C countdown=0 no response received - removed from send queue

@marekorok would be great if you could provide some additional info.
I have the same RS485 plate as you and Wemos D1 mini. What is your connection:
Did you connect E (earth) to RS485 on the side with A+ and B-)? On the photo i don’t see it.
Are you connecting Tx from the RS485 to the GPIO5 and Rx to GPIO4?
What is your addres on the S3 rotary switch on the mainboard assuming that on the wired controller it’s 1?
Regards
Tomasz

Update :slight_smile:
Got it working! I tried all kind of combination with speed and wires between RS485 and ESP and also changed wires betwenn RS485 and HP controller but nothing worked, with one excpetion: once i noticed reading only two parameters, only once and then again nothing.
So after some digging i’ve changed pins on ESP to D5 (rx) and D6 (tx) and boom! That is working flawlessly!

Now the fun part begins…
Does anyone know how to properly read and write data from this registers?
image

Regards
Tomasz

Hi all, I have the Midea MHC-V22W/D2RN8 heat pump, which seems that supports modbus.

On the main board I can see the H1/H2 (H2 = A+ and H1 = B-) terminals.

Since I have an RS485/USB Interface, does anyone know what packet I can try to send in order the pump to reply back? The crc polyonimal is the common 0xA001 ?

It seems from the rotary switch that the default slave address is 16.

hi @tomasz_p, nice!

for bits you need to use bitmask, here you have few examples:

binary_sensor:
  - platform: modbus_controller
    id: ${heat_pump_name}_R0B0_room_temperature_control
    name: hp_R0B0_floor_heating
    #R0,B0: room temperature control
    register_type: holding
    address: 0
    bitmask: 0x1
  - platform: modbus_controller
    id: ${heat_pump_name}_R0B1_heating
    name: hp_R0B1_floor_heating
    #R0,B1: 0: power off floor heating; 1: power on floor heating;(zone 1)(water flow temperature control
    register_type: holding
    address: 0
    bitmask: 0x2
  - platform: modbus_controller
    id: ${heat_pump_name}_R0B2_dhw
    name: hp_R0B2_dhw_heating
    #R0,B2 0: DHW(T5S) power off; 1: DHW(T5S) power on
    register_type: holding
    address: 0
    bitmask: 0x4
  - platform: modbus_controller
    id: ${heat_pump_name}_R5B11_constant_temp_water_recycling
    name: hp_R5B11_constant_water_recycling
    # R5,B11: HW pump's running constant-temperature water recycling
    register_type: holding
    address: 5
    bitmask: 0x800
  - platform: modbus_controller
    id: ${heat_pump_name}_R5_B10_ECO_Mode
    name: hp_R5B10_ECO_mode
    # R5,B10 ECO Mode
    register_type: holding
    address: 5
    bitmask: 0x400
  - platform: modbus_controller
    id: ${heat_pump_name}_R5B8_Holiday_Home
    name: hp_R0B8_holiday_Home
    # R5,B8 Holiday home (the status can only be read, not changed)
    register_type: holding
    address: 5
    bitmask: 0x100

btw, I have rebuild my modbus reader with plain ESP12E module extracted from wemos :-), which fits nicely within the display, 3.3V power got from CN6 connector:

Thanks @marekorok but it doesn’t seems to work for me. With your code I only got some reading e.g. R0B0 saying “normal”.

I also tried “number” on address 3, 4 and 11 and first two seem to work but 11 doesn’t. It shows 2°C and when i chage it’s value it stays on for a couple of seconds and the goes back to 2°C.
My code looks like this:

number:
  - platform: modbus_controller
    id: ${heat_pump_name}_3
    name: "hp_Set_air_Temp_Tas"
    address: 0x03
    unit_of_measurement: "°C"
    value_type: U_WORD
    min_value: 17
    max_value: 30
    multiply: 2.0
  
  - platform: modbus_controller
    id: ${heat_pump_name}_4
    name: "hp_Storage_tank_water_temp_T5s"
    address: 0x04
    unit_of_measurement: "°C"
    value_type: U_WORD
    min_value: 20
    max_value: 60
    multiply: 1.0

  - platform: modbus_controller
    id: ${heat_pump_name}_11
    name: "hp_Water_temp_setting_T1s"
    address: 0x0A
    unit_of_measurement: "°C"
    value_type: U_WORD
    min_value: 30
    max_value: 60
    multiply: 1.0

and in HA for now i got this:
image

@SavKok you can’t use connectors H1 and H2 on the mainboard. They are used for connecting other heat pump units in cascade. The only proper way is to use H1 and H2 on the wired controller.

And i also managed to fit all stuff in the wired controller as i finally used wemos D1 mini v4 which is very flush and has USB-C. The other good news is that on my unit i got straight GND, 3,3V and 5V. Here’s a photo of these points located under the semi-transpared shield.

please notice I’m using these as binary_sensor giving a bit valut 0/1, on/off etc
image

I’m not yet doing any changes so can’t help, for the moment I’m just collecting data for graphs and analysis.
anyway powodzenia :slight_smile:

btw: seems your display unit is totaly different than mine…

@tomasz_p Actually I have the Midea MHC-V22W/D2RN8 heat pump. So the proper way to connect to the Modbus is by using the A/B from wire controller or connector CN30, right?

image

Sorry for the terrible resolution.

@SavKoK I think it doesen’t matter what model you have because genuine Midea and all of it’s clones work the same way. I dont’ have manual for original Midea, but in Kaisa and also Clivet it’s shown the same way. Here you have part of the service manual of my unit. It’s clear:

1 Like

@tomasz_p This note that “wired controller is integrated” is what confuses me. I will check my heat pump and report back.

It says integrated because that’s where it’s mounted in the factory when it comes to the split units which i have. It can be taken from it and mounted wherever you want. In monoblock version it’s just a standalone item.

1 Like

I just read some registers on a MIDEA heat pump through Modbus. I just used the H1/H2 from wired controller as @tomasz_p recommended :slight_smile:

Address Meaning Description HEX Value DEC Value Comment
100 Operating frequency Compressor operating frequency in Hz.
Value read = current value
001B 27 Seems ΟΚ
101 Operation mode Unit’s operation mode,
0: shut down
2: cooling,
3: heating,
0003 3 Seems ΟΚ
102 Fan speed Fan speed, unit: rpm. Value read = current speed value 0208 520 Seems ΟΚ
103 PMV ODU electronic expansion valve opening, unit: P. Value read = current value (shows only 8 multiples. Only multiples of 8 will be shown) 00B0 176 Seems ΟΚ → 22*8
107 T4 temperature Outdoor temperature, unit: °C. Value read = current value 0010 16 Seems ΟΚ
118 ODU current Current ODU value, unit: A, Value read = current value 0005 5 Seems ΟΚ
119 ODU voltage ODU voltage value, unit: V. Value read = current value (reserved) 00E8 232 Seems ΟΚ → 230V = 1P
132 Unit target frequency Compressor target frequency in Hz. Send value = actual value 001C 28 Seems ΟΚ → Compared to 100 register
134 DC bus voltage Return value = actual value / 10 (Unit: Volts) 0039 57 Seems ΟΚ → 570VDC = 3P

I think the values seem reasonable.

Hi,

Since it already some time ago that information about Midea heat pumps using ESPHome/modbus is posted here, so let me do an update of the current state of my project.
My goal is to create an ESPHome based solution for Midea heat pumps and clones which can be used by others who do not have the time/capability to create such.

My son (electronics student) designed a small board which can be easily connected to the heat pump and I am working on to get all the registers available in Home Assistant and for some of them I want to be able to update the value.

The prototype of the board:

Most off the registers are working now, also those where multiple values are behind one register (bitmasks) and I am also able to turn on the DHW tank heater (register 7) and configure the leaving water temperature for zone 1 and zone 2 (register 2). Especially the last one was a bit harder to get right.

Being able to write to all the registers is now more a matter of implementing it, but I think also a lot should not be that easy settable by an ordinary user, so I have to see what to expose and not.

If somebody wants to see my current config, just sent me a message. I am not posting it completely here, since I am still working on, but it would be sad if you are spending a lot of time in things I already found out how it works :slight_smile:

3 Likes

Hi @Mosibi,
glad to hear that you’re working on this. I’d like to see your config.

1 Like

I’d love to have a look at your config also!
I briefly tried to get rs 485 comms working but alas had no joy. I suspect it was my esphome config that was at fault.

Also, love the pcb design!

1 Like

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?