Midea branded AC’s with ESPhome (no cloud)

edit: on a whim, I unplugged it and plugged it back in and it’s working now. I did try killing power before and that didn’t work. I think it was not plugged in all of the way…

Brand: MRCOOL
Model ID: DIY-24-HP-WMAH-230C25
Year: 2022
Market: US

It is not working currently. My esp is getting power from the mini-split and is connecting to my home assistant server. But, it’s not able to communicate with the mini-split. The ESPHome log for the device looks like the following in an infinite loop:

21:25:49	[D]	[ApplianceBase:139]	

Response timeout...

21:25:49	[D]	[ApplianceBase:154]	

Destroying the request...

21:25:49	[D]	[AirConditioner:178]	

Enqueuing a GET_STATUS(0x41) request...

21:25:49	[D]	[ApplianceBase:173]	

Enqueuing the request...

21:25:49	[D]	[ApplianceBase:075]	

Getting and sending a request from the queue...

21:25:50	[D]	[ApplianceBase:162]	

TX: AA 21 AC 8D 00 00 00 00 00 03 41 81 00 FF 03 FF 00 02 00 00 00 00 00 00 00 00 00 00 00 00 03 E9 42 B0 

21:25:51	[D]	[ApplianceBase:139]	

Response timeout...

21:25:51	[D]	[ApplianceBase:146]	

Sending request again. Attempts left: 2...

21:25:51	[D]	[ApplianceBase:162]	

TX: AA 21 AC 8D 00 00 00 00 00 03 41 81 00 FF 03 FF 00 02 00 00 00 00 00 00 00 00 00 00 00 00 03 E9 42 B0 

21:25:53	[D]	[ApplianceBase:139]	

Response timeout...

21:25:53	[D]	[ApplianceBase:146]	

Sending request again. Attempts left: 1...

21:25:53	[D]	[ApplianceBase:162]	

TX: AA 21 AC 8D 00 00 00 00 00 03 41 81 00 FF 03 FF 00 02 00 00 00 00 00 00 00 00 00 00 00 00 03 E9 42 B0 

21:25:55	[D]	[ApplianceBase:139]	

Response timeout...

21:25:55	[D]	[ApplianceBase:154]	

Destroying the request...

21:25:55	[D]	[AirConditioner:178]	

Enqueuing a GET_STATUS(0x41) request...

21:25:55	[D]	[ApplianceBase:173]	

Enqueuing the request...

21:25:55	[D]	[ApplianceBase:075]	

Getting and sending a request from the queue...

21:25:56	[D]	[ApplianceBase:162]	

TX: AA 21 AC 8D 00 00 00 00 00 03 41 81 00 FF 03 FF 00 02 00 00 00 00 00 00 00 00 00 00 00 00 03 EA A0 51 

21:25:57	[D]	[ApplianceBase:139]	

Response timeout...

21:25:57	[D]	[ApplianceBase:146]	

Sending request again. Attempts left: 2...

21:25:57	[D]	[ApplianceBase:162]	

TX: AA 21 AC 8D 00 00 00 00 00 03 41 81 00 FF 03 FF 00 02 00 00 00 00 00 00 00 00 00 00 00 00 03 EA A0 51 

21:25:58	[D]	[AirConditioner:132]	

Enqueuing a GET_POWERUSAGE(0x41) request...

21:25:58	[D]	[ApplianceBase:173]	

Enqueuing the request...

The yaml configuration looks like this:

esphome:
  name: garage-mini-split
  platform: ESP8266
  board: esp12e

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Garage-Mini-Split"
    password: "REDACTED"

captive_portal:

# Enable logging
logger:
  baud_rate: 0

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

ota:
  password: "REDACTED"

uart:
  tx_pin: 1
  rx_pin: 3
  baud_rate: 9600
  
  
climate:
  - platform: midea
    name: Garage Mini Split     # 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:            # All capabilities in this section detected by autoconf.
      - FAN_ONLY                # This capability is always used.
      - HEAT_COOL
      - COOL
      - HEAT
      - DRY
    custom_fan_modes:
      - SILENT
      - TURBO
    supported_presets:          # All capabilities in this section detected by autoconf.
      - ECO
      - BOOST
      - SLEEP                   # This capability is always used.
    custom_presets:             # All capabilities in this section detected by autoconf.
      - FREEZE_PROTECTION
    supported_swing_modes:
      - VERTICAL                # This capability is always used.
      - 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


web_server:
  port: 80

I have a feeling that since it’s a new model then the confirmed to work ones on this list; they might have blocked this or something… Another thing that may be of note, is that I used the dongle that came with it at first. So, maybe it received a firmware update if it would have even worked in the first place.

What kind of connector you use?
If seen several cases where the connection is just bad (or the converter, or esp module)

  • is it possible to hardwire it (f.e. soldering)
  • did you try with another converter?
  • can you try another esp module?

If you are replying to me then I solved it by making sure the USB was in all of the way. It was plugged in enough to get power but not the data pins. It’s working now! :slight_smile:

1 Like

@Trevo525 Right, wasn’t sure as the ‘edited’ was on top…good job!!

Hi,

I have connected the svenar heatpump controller and have the values in HA. Great!

But is it possible to share your home assistant config, the dashboard etc.?

Thanks,
Jan

1 Like

Hi Jan,

I don’t have a dashboard with only the information from the heatpump, I have it combined with information from the Shelly devices that we use to monitor the power usage of the internal and external unit.

I can of course sent you that dashboard, but then you will have a lot of stuff that does not work. If I have time this weekend, I can create a clean one, with only the heatpump metrics.

Hi,

The stuff that doesnt work i can strip out, don’t want you spend your weekend doing stuff you already done :wink:

Thanks,
Jan

I created a (very) stripped down version of my current dashboard, with only the sensors from the heatpump on it. You can find the dashboard, but also 2 automations I use, on https://github.com/Mosibi/Midea-heat-pump-ESPHome/tree/master/homeassistant

For comparison, this is my current complete dashboard

2 Likes

Thanks a lot!, and nice work on the out of the box working module for the heatpump!

Jan

1 Like

Hello,

I have a Qlima S34252 (Midea unit), with the attached PCB board. The wiring diagram also refer to WiFi controller(optional), but I can not see any pinout or connectors on the board for this(see picture attatched of the LED/IR Display Board.

Is there a way I can replace the PCB board, to get WiFi stick so I can control it through home assistant?

I don’t know if adding the pcb would do the trick.
According earlier posts, the unit must be wifi prepared.

Hello, I am reading the data via modbus (esphome) with an esp8266. It is a Kosner Heatpump, it is identical to Midea. I am trying to change the data of the ninth curve. and with two of them I have problems. T1SetH1 and T1SetH2 are correct values and can be changed, however the entities T4H1 and T4H2 appear to have incorrect values and are outside the configured range and changing.

  # Register: 267
  - platform: modbus_controller
    modbus_controller_id: "${devicename}"
    name: "${entity_prefix} T4H1"
    id: "${devicename}_t4h1"
    register_type: holding
    address: 0x10b
    value_type: S_WORD
    unit_of_measurement: "°C"
    entity_category: config
    min_value: -25
    max_value: 35
  # Register: 268
  - platform: modbus_controller
    modbus_controller_id: "${devicename}"
    name: "${entity_prefix} T4H2"
    id: "${devicename}_t4h2"
    register_type: holding
    address: 0x10c
    value_type: S_WORD
    unit_of_measurement: "°C"
    entity_category: config
    min_value: -25
    max_value: 35

Can you check which value is set in the menu/display on the controller self?

yes, this values in menu/display is correct. T4H1: -5 and T4H2: 7

And to understand the issue, in HA you saw the good value for both settings and after changing both, you get the high values? And still the heatpump shows the right values ?

the values, from the beginning they are shown wrong, if I change them in HA, for a moment they are shown correctly, but when you update the sensors it shows values out of range and every time the sensors are updated (10 seconds), this wrong value changes and goes out of range.
With no other data I get this error. And there are other negative value number type sensors as well (S_word) that work without problems.
In the controller menu, the values are always displayed correctly.
Update:
I have changed the controller for an esp32c3, in case it was a cpu or ram problem, since the esp8266 is still very tight.
The result is the same, only those 2 values cause problems.
I’m using your code, by the way, thanks for sharing it.
On the web server, you see the error it gives.

11:18:36	[E]	[modbus_controller:068]	
Modbus error function code: 0x6 exception: 2 
11:18:36	[E]	[modbus_controller:077]	
Modbus error - last command: function code=0x6  register address = 0x10B  registers count=1 payload size=2

11:21:48	[E]	[modbus_controller:068]	
Modbus error function code: 0x6 exception: 2 
11:21:48	[E]	[modbus_controller:077]	
Modbus error - last command: function code=0x6  register address = 0x10C  registers count=1 payload size=2

Hello…

I did read that you got the premade dongle…is that dongle able to provide the IR follow me and such function as the github page suggests from dudanov?

the dongle is a standard esp32 .
https://wiki.seeedstudio.com/XIAO_ESP32C3_Getting_Started/
If you need to have IR communication, you will have to add an infrared LED and a resistor and program it in the esphome code

Hello and thx for the quick response, i was hoping it would be this one: Dudanovs ir enabled dongle
Since i lready have 2 of the regular ones but cant get the ir feature going where tou tab i to the receiving leg of the ir module
And dudanovs tindie shop is not existing anymore and the info email from this dongl maker comes back as full so i cannot ask him either

in the Dudanovs page Comment that it is possible to order the pcb from JLCPCB, you have the documentation on their github. They can even solder the components for you. It’s going to be a little more expensive than if you order it directly from him or his store, I guess.
But this is a different project from the one I am commenting on. They are two different machines and different protocols.