Midea branded AC’s with ESPhome (no cloud)

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!

@Jozsi_Csoka @Mosibi @Bryla
I don’t want to disturb you guys here, but don’t you think, it would be better to open up a new thread for the heatpumps? :slight_smile: You’re gathering a lot of useful information here, but I highly doubt anybody will find this in the future when other posts (about the ACs) come in between.

Just a suggestion, no offense, but it would really be a shame, if this info gets “lost” in the middle of this thread… :slight_smile:

If you want to have posts moved, I’m quite sure, one of the moderators will be helpful here, eg. ask @Petro to move these posts. :slight_smile:

EDIT/PS: If you choose to seperate the threads, would one of you be so kind and tag me in the new thread, so I don’t miss it? Thanks a lot! :slight_smile:

That register contains a 8 bits value which can be found in my config as binary_sensor, see from line 1173

I agree with you that we better can make a dedicated topic for the heatpumps. @petro can you fix this for us?

EDIT: This is now solved. Solution was to switch RX and TX in the Yaml.

To prove your point: here is a question about AC :grimacing:

I have configured a Wemos D1 Mini (esp8266) but I can’t get it to work with my Midea Mission Pro. The logging mentions: [W][midea:113]: Failed to get 0xB5 capabilities report.

The Mission Pro should work as mentioned by @awenger here. Also I found multiple posts from others using the Wemos and I am using the same hardware for my Haier AC without any issues.

Am I missing something? To rule out configuration errors I used the sample configuration from ESPHome. The pinout is correct for my hardware.

My yaml is below, any ideas?

esphome:
  name: d1-mini-midea

esp8266:
  board: d1_mini

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxx"

ota:
  password: "xxxxxxxxxxxxxxxxxxxxxxxx"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "D1-Mini-Midea Fallback Hotspot"
    password: "tfnpxtiOZjnb"

# Example configuration entry

# Disable logging over UART (required)
logger:
  baud_rate: 0

# UART settings for Midea dongle (required)
uart:
  tx_pin: 1         # hardware dependant
  rx_pin: 3         # hardware dependant
  baud_rate: 9600

# Main settings
climate:
  - platform: midea
    name: Midea Climate         # Use a unique name.
    period: 1s                  # Optional
    timeout: 2s                 # Optional
    num_attempts: 3             # Optional
    autoconf: true              # Autoconfigure most options.
    beeper: true                # Beep on commands.
    visual:                     # Optional. Example of visual settings override.
      min_temperature: 17 °C    # min: 17
      max_temperature: 30 °C    # max: 30
      temperature_step: 0.5 °C  # min: 0.5
    supported_modes:            # Optional. All capabilities in this section may be detected by autoconf.
      - FAN_ONLY
      - HEAT_COOL
      - COOL
      - HEAT
      - DRY
    custom_fan_modes:           # Optional
      - SILENT
      - TURBO
    supported_presets:          # Optional. All capabilities in this section may be detected by autoconf.
      - ECO
      - BOOST
      - SLEEP
    custom_presets:             # Optional. All capabilities in this section may be detected by autoconf.
      - FREEZE_PROTECTION
    supported_swing_modes:      # Optional
      - VERTICAL
      - HORIZONTAL
      - BOTH
    outdoor_temperature:        # Optional. Outdoor temperature sensor (may display incorrect values after long inactivity).
      name: Temp
    power_usage:                # Optional. Power usage sensor (only for devices that support this feature).
      name: Power
    humidity_setpoint:          # Optional. Indoor humidity sensor (only for devices that support this feature).
      name: Humidity

Hello,

HA fan at home, and found this thread then the Midea Duo 14,000 BTU AC + Heater had me set up the WiFi and it behaved just like all my ESP chips do. So I wondered if this can be integrated so I can dump the online accounts.

This one was not in the list, but I like to tinker. It’s the Midea Duo MAP14HS1TBL sold as a Toshiba RAC-PT1412HVWRU at Home Depot. (You register it via the Toshiba APP, and Midea sends you your verification link.)

It’s one with the AC and Heater modes. I have a number of USB ESP Chip programmers already on my hobby bench, so I am looking to see what combo might work. Will tear into the WiFi module soon to see what is presented to me.

Anyone go down this road yet with this model?

OK, so this is what I have under the hood :smiley: