Midea branded AC’s with ESPhome (no cloud)

Hello everyone, hello Mosibi

First of all, sorry for the Google translation into English.

After several days of trying to establish a connection to my Midea Klone Kaisai heat pump, I am asking for your help. I’m a total novice when it comes to programming. The connection between the Pi3B+ and the boardBoard is successful. Likewise the integration to HA. But then the problems start. My first attempt with USB to RS485 converter from Mosibi failed after various attempts. Then I tried again with this one. Converter2

The TX LED shows me that the program is queried at 10-second intervals. The RX LED for receiving remains dark. I’ve tried all possible solutions. These were: All 16 addresses 0x0 to 0xF in the program changed, with some addresses the error ”Duplicate Modbus found” appears. Pin 16/17 changed to pin 1/3. 120 ohm resistor soldered in, here only error messages like "CRC Check failed”. Then the same mass / earth on the board as well as on the display of the pump. Tried 3 out of 5 boards. Flow control pin 5 removed from the program, boards have automatic flow control. Cable type changed. Now I’ve given up because I don’t have a new approach anymore. Maybe something else in the program that I don’t see? I added the personalized YAML. Does somebody has any idea?

Thanks in advance, Volker

substitutions:
  devicename: heatpump
  description: Heatpump Controller
  entity_prefix: Heatpump

globals:
  - id: unmasked_value_water_temperature_t1s
    type: int
    restore_value: no
    initial_value: '0'
  - id: unmasked_curve_selection
    type: int
    restore_value: no
    initial_value: '0'

esphome:
  name: "${devicename}"
  comment: "${description}"
  friendly_name: "${description}"

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
  level: INFO
  baud_rate: 0

# Enable Home Assistant API
api:
  encryption:
   key: "U6usp04Lr2zFM6KOn044EyMSp5+UxLPjHSqrTza3TJo="
    
web_server:
  port: 80

ota:
  password: "4838b17608a38073aa52fabd0888f579"
  
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${devicename}"
    password: "zHZ2Ur5uDMVz"

captive_portal:

uart:
  id: mod_bus
  tx_pin: 1
  rx_pin: 3
  baud_rate: 9600
  stop_bits: 1

modbus:
   id: heatpump_modbus

modbus_controller:
  - id: "${devicename}"
    ## the Modbus device addr
    address: 0xF
    modbus_id: heatpump_modbus
    setup_priority: -10
    update_interval: 10s

sensor:

As a last chance, I would like to access Mosibi’s board

Hi @volkerni ,

I have no idea what’s exactly wrong with your setup, also because I don’t see how you exactly are using the boards you mentioned. The board we (son and I) created is ready, we are creating documentation that we want to sent with it, but I can send it without that documentation if you want. Just send me a message, so we can talk about the possibilities.

For other readers, I have a stock of 4 boards now.

Hello Mosibi,
first of all thanks for the answer. I would also like to take a board without documentation. Unfortunately I can’t send you a private message as a new member. You are welcome to send me an email (volkerni1atgmailcom) in which we can clarify everything else. Thank you, Volker

@exciton sorry but that did not happen to me. I have a duct unit and an wired remote. I can not reproduce the scenario on my setup. Everything is in Celsius on my side.

@bwiggins I am using the ready-made SLWF-01pro (v1.1) with default config (they come pre-flashed):

esphome:
  name: air-conditioner
  platform: ESP8266
  board: esp12e
  name_add_mac_suffix: true

wifi:

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "AC-wifi"
    password: "slwf01pro"

captive_portal:

# Enable logging
logger:
  baud_rate: 0

# Enable Home Assistant API
api:

ota:

uart:
  tx_pin: 1
  rx_pin: 3
  baud_rate: 9600
  
  
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:            # 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
1 Like

Is it possible to turn off the fan when the AC is “on” but the temperature is within the set range? Right now it keeps spinning and creates an unwanted draft

I have an automation set up using a schedule helper that sets the hvac mode to heat_cool with a min-max temperature. The schedule turns on the AC in heat_cool mode after which the AC checks the temp, the temp is ok and it should do nothing. But still the fan is running (without cooling or heating, just the fan). Is this just how this AC is supposed to work, or can I disable it somehow?

description: ""
trigger:
  - platform: state
    entity_id:
      - schedule.ac_schedule_keuken
condition: []
action:
  - if:
      - condition: state
        entity_id: schedule.ac_schedule_keuken
        state: "on"
    then:
      - service: climate.set_temperature
        data:
          hvac_mode: heat_cool
          target_temp_high: 24
          target_temp_low: 18
        target:
          device_id: 420c7c08d2be1c310c16763a2461294f
    else:
      - service: climate.set_hvac_mode
        data:
          hvac_mode: "off"
        target:
          device_id: 420c7c08d2be1c310c16763a2461294f
mode: single

it is how the AC is supposed to work…
But why not use your automation to turn the AC off when lower temperature is reached, and on again when max temp?

That is a great idea!

Do you have a suggestion how I can automate this?

check this thread?

1 Like

Hi there,

I successfully got this working on a mr cool diy third gen about a year ago, however I just purchased two 4th gen units and esp home does not get any info from the units nor can it control. I made sure everything on the new dongles were wired correctly. I also tried the working dongle I made for the third gen unit as well with no luck.

Has anyone had any luck with a 4th gen unit? Or anyone have any ideas what could have changed?

I am wondering if the firmware of the unit itself changed something.

what type of dongle does it originally use?
osk-10??

How can I tell? Open the OEM dongles case?

Here is the dongle that came with the 3rd gen.

This dongle, when I plug it into the 4th gen units it works fine and shows up as the name of the third gen unit I had initially set it up with… but of course it will work, its the Mr cool dongle.


This is the dongle that came with the 4th gen


Also, in the mr cool app, the gen3 says it’s firmware 2.5.3,2.5.0 and the 4th gen says 2.6.0,2.6.0

I wonder if I can downgrade the firmware somehow

Were you able to get this to work? I just got a Senville unit and looking at my options to integrate it with Home Assistant

Not sure if it can be downgraded, but I guess there is something different compared to your 3rd gen.

Also it falls a bit out of the scope here, as it assumed the module is flashed with the esphome firmware…

If it does have an option to update the firmware using it’s webinterface, you could reflash it with esphome (i only can’t help with the correct GPIO pin-out :thinking: )

I ended up purchasing the prebuilt ESP unit from this website and it works. I have the full ability to control the unit and also get the outdoor temperature status of the unit outside, no humidity or power info. Shipping does take a while though

great, thank you! I will order one too. I expect it to take a while.

I wonder if it is possible to make this work with the midea cube dehumidifiers? they have audino based mqtt control but i haven’t had amazing success with it.

I just would like to clarify why I sent you the photos I sent you, and I would also like to just make sure my question was understood.

You asked me for the original wifi module that the unit came with:
“what type of dongle does it originally use?
osk-10??”

that’s why I sent you these pictures of the original dongles and not my dongle I made with esphome. I opened the white plastic case, and snapped pics of the original USB “smart wifi” that Mr Cool sells with the units. I have no idea what osk-10 is, so maybe it’s a firmware or OS or a board that some mini splits normally come with?

This is a photo of the module I made with the ESP home firmware that works for my 3rd gen Mr Cool Mini split, but does not work for my 4th gen mini split. (which I was able to make with information here)

It’s alright, if it falls out of the scope here then I guess I don’t know where else to turn, lol. This is where I came to originally flash my 3rd gen. Was able to make the dongle above, and control it with esphome using the midea component.

When you open the mini splits “hood”, there is a board that the USB connects to, which has the same serial number on this piece on my 3rd and 4th gen units. then that board has a wire going to another board, which also has the same serial number on it.

I even swapped them around from my 3rd to my 4th gen. Only thing I can really think of is they did something with a firmware update, which if that’s the case, I was only asking on here as it’s the only place on the entire internet where people are talking about flashing esp home on mini splits and just wanted to see if someone was able to do it.

I am not trying to come across rude, I’m just super frustrated, not anyones fault here. The only reason I spent so much money on these 4th gen’s DIY units is because I was able to successfully pull it off on a 3rd gen, and I thought in my head that there’s no way they woulda done something about this, it’s not that popular of a “hack” that they’d kill it. (I coulda gotten off brand ones installed for cheaper than what I paid for the Mr Cool Units that I had to install myself)

The OSK-102/3/4 are the original Midea dongle’s; they are not using the regular ESP modules.
image
Since your picture shows it uses the ESP-12F, it should be reprogramable (but maybe requires some direct wiring).

It could be something very silly, as I’ve seen some people having contact issues (as the port may look like USB, but it is not; the corners of the socket are cut of and a standard USB may not fit properly/not making proper contact…
image
This is also the reason I prefer to use the header plug instead of the USB :thinking:

You are not rude; no offence take in any way :smiley:

1 Like