Midea branded AC’s with ESPhome (no cloud)

Hello, I installed a Heat Pumpe last Oktober. Now I really interested in your board and current configuration. I only see the data on the little board or MSmartHome. I’d like to hear from you. Achim

Hey, are you still working on the project? I’m thinking about purchasing a Midea heat pump but before I do I want to make 100% sure I can read out all kinds of data and I will be able to control it externally as I never trust such a device when the behaviour is not exactly predictable.

Depends what midea heatpump/ac u r actually aming for…

Hi Achim,

See GitHub - Mosibi/Midea-heat-pump-ESPHome for the most recent config. This week the first round of boards have arrived and we will soon start with the tests. Our prototype board is still in use and the results are very good, so we do not expect (big) issues.

You could have have a look at the project I am working on.

it is not enough for you?

very good project, I’m following it! pymodbus is very unreliable.

If someone knows, which Modbus register on Midea should I check to calculate/get the power consumption?

I found the registers 143+144 might be useful. Does the read value represent a kWh/increment?

yes, if using esphome then you can use total_increassing class and read it easily as double word:

- platform: modbus_controller
    id: ${heat_pump_name}_143_dword
    name: "hp_energy_consumption"
    state_class: total_increasing
    register_type: holding
    address: 0x8F
    unit_of_measurement: "kWh"
    value_type: U_DWORD
1 Like

My Midea clone name is Hajdu HPAW 6.
Strange, my 143 is empty. but 144 has data. What is 144?
image

U_DWORD combines the first register 143 and(!) the next register 144 into one value. 143 contains the lower bits and 144 the higher bits for that value (bitwise AND)

Very nice work, congratulations again! Would it be possible for you to help a little more? There is also a Midea Fan-coil, connected to the same Modbus network in a daisy-chain. That slave: 2 devices. it doesn’t have much value. Would you mind including it in this super yaml file?

@Mosibi
How can you switch the heatpump on/off?

@Mosibi hi, i’m trying to use your .yaml file in ESPhome, but on d1 mini. I changed settings for esp8266, but after flash i get this in logs. I’m not connected to the pump yet, could this be the fault? image

I am trying to keep the yaml as generic as possible. For people that do not have the device, adding those registers, would result in errors in the log.

Completely power off? I don’t think that is possible with the Heatpump. In my own setup I’ve attached the internal and external unit to a Shelly device, which give me the option to power off and on both units.

This error is unknown to me, but a bit of googling learned me that it could be related to the used settings with certain hardware. See for example this topic: Wemos NodeMCU CH340 not working · Issue #3831 · esphome/issues · GitHub

I mean to set auto/cool/heat/off modes. It’s as if your yaml description doesn’t know this. However, this can be solved on modbus if I send a power off command to the address 40001. :
- name: HPAW 000 Power on or off
slaves: 1
address: 0
- name: HPAW 001 Setting the mode (auto/cool/heat)
slaves: 1
address: 1

Yes, I know, you’re absolutely right.
Then could you help with how to define the device set to slave 2 on the same chain in the yaml file?
Also, if you accept a piece of advice, you also enter the modbus address for the items in the yaml file. so it arranges the elements in ABC order and becomes completely illogical. If the original numbering is preserved, the data will appear more logically.

Found it, it was out of memory error. I removed some of the registers and now it’s working great, fantastic project!