Midea branded AC’s with ESPhome (no cloud)

Thanks for the tip but I already got the female usb to jst cable

Hi again guys, for anyone in need, I managed to make the “midea-AC” dongle work. I was having the same problem as meatljay.

What I did was:

  • create a node in ESPHOME
  • paste all the code metaljay had from the seller ( here )
  • made some changes and updated via OTA and it solved my problem
  node_name: midea-ac
  node_id: midea_ac
  friendly_node_name: "Midea AC"

esphome:
  name: room-ac
  comment: room-ac
  platform: ESP8266
  board: esp12e
  #name_add_mac_suffix: true
  #project:
   # name: "lizardsystems.midea_mini_dongle"
    #version: "1.4.0"

wifi:
  ssid: "yournetworkname"
  password: "yourpassword"
  ap:
    ssid: "AC-wifi"
    password: "slwf01pro"

  manual_ip:
    static_ip: 192.168.88.53 
    gateway: 192.168.88.1
    subnet: 255.255.255.0

captive_portal:

#disabled the ones below
#dashboard_import:
  #package_import_url: github://lizardsystems/midea-mini-dongle/edit/main/midea_ac.yaml

logger:
  baud_rate: 0
#  level: ERROR
  esp8266_store_log_strings_in_flash: false

ota:

web_server:
  port: 80
  css_url: ""
  js_url: "www.js"
  local: true
  version: 2
  

api:

uart:
  tx_pin: 1
  rx_pin: 3
  baud_rate: 9600
  
climate:
  - platform: midea
    name: room-ac Climate         # Use a unique name.
    id: roomac_climate
    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    # min: 17
      max_temperature: 30    # max: 30
      temperature_step: 0.5  # 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
    power_usage:                # Optional. Outdoor temperature sensor (may display incorrect values after long inactivity).
      name: "${friendly_node_name} Power Usage" 
      id: ${node_id}_power_usage
    outdoor_temperature:        # Optional. Power usage sensor (only for devices that support this feature).
      name: "${friendly_node_name} Outdoor Temperature"
      id: ${node_id}_outdoor_temperature
    humidity_setpoint:          # Optional. Indoor humidity sensor (only for devices that support this feature).
      name: "${friendly_node_name} Humidity"
  
switch:
  - platform: template
    name: ${friendly_node_name} Beeper
    icon: mdi:volume-source
    restore_state: true
    optimistic: true
    turn_on_action:
      midea_ac.beeper_on:
    turn_off_action:
      midea_ac.beeper_off:
      
binary_sensor:
  - platform: status
    name: ${friendly_node_name} Connection Status
    id: ${node_id}_connection_status

text_sensor:
  - platform: template
    name: Uptime Human Readable
    id: uptime_human
    icon: mdi:clock-start

  - platform: version
    name: ${friendly_node_name} ESPHome Version
    id: ${node_id}_esphome_version    

  - platform: wifi_info
    ip_address:
      name: ${friendly_node_name} IP Address
      id: ${node_id}_ip_address
      icon: mdi:ip-network

sensor:
  - platform: uptime
    name: Uptime Sensor
    id: uptime_sensor
    update_interval: 60s
    on_raw_value:
      then:
        - text_sensor.template.publish:
            id: uptime_human
            state: !lambda |-
              int seconds = round(id(uptime_sensor).raw_state);
              int days = seconds / (24 * 3600);
              seconds = seconds % (24 * 3600);
              int hours = seconds / 3600;
              seconds = seconds % 3600;
              int minutes = seconds /  60;
              seconds = seconds % 60;
              return (
                (days ? to_string(days) + "d " : "") +
                (hours ? to_string(hours) + "h " : "") +
                (minutes ? to_string(minutes) + "m " : "") +
                (to_string(seconds) + "s")
              ).c_str();
  - platform: wifi_signal
    name: ${friendly_node_name} WiFi Signal
    id: ${node_id}_wifi_signal
    update_interval: 60s

button:
  - platform: restart
    name: ${friendly_node_name} Restart
    id: ${node_id}_restart
    icon: "mdi:restart"
  - platform: shutdown
    name: ${friendly_node_name} Shutdown
    id: ${node_id}_shutdown
  - platform: safe_mode
    name: ${friendly_node_name} Restart (Safe Mode)"
    id: ${node_id}_safe_mode
type or paste code here

Hope it helps

Hope it helps!

followed by

??
As mentioned in previous posts, you either specify the supported modes OR you use autoconf=true :thinking:

And i recently updated the yaml in the 1st post, you can use that one ( the above still applies regarding autoconf) :wink:

2 Likes

thanks aceindy, i was following the thread did not check the first posts.

Now im going try to recover the other dongle who got lost in space (wrong network info and AP mode off)

Hi Jakob,
it seems I have a similir heat pump branded hyundai but based on Midea. I’m struggeling to connect to the Modbus interface. For debugging I’m using a RS458 → ETH converter.
If I conect this to the H1, H2 and ground terminals on the external controller I can’t read any modbus registers. If I connect to H1/H2 in the Heat Pump I receive some garbage but no Modbus communication. Do you know if this Modbus feature needs to be enabled somehow in the controller?

Thanks,
Seb

I purchased a SLWF-01pro from smartlight.me and connected it to my Home Assistant as documented by them. It shows up in my Integrations under ESPHome and properly identifies itself as a climate entity and outdoor thermometer. All good so far.

However, it doesn’t show up on the actual ESPHome panel as something I can update or modify.

What’s the process for getting ESPHome to “adopt” it so it can manage it? Or should I, even?

1 Like

the esphome panel is only for programming, it doesn’t have any other purpose…
so, up to you….

You can always use the example config from the 1st post :wink:

I’ve also bought an SLWF-01pro from smartlight.me.
I want to reflash the esp12f chip but I don’t know how to do.

I have connected to ESPHome in home assistant but it’s undetected. Same things on windows. On the board there is two button (RES and FLH).
I’ve tried a lot of time but nothing happen

  1. Compile the bin’s using the ESPHome addon, and choose ‘manual download’; store the bin’s somewhere, power on your SLWF-01, and connect to it using it’s HotSpot, and upload the previously download bin file using it’s web insterface.
    image

  2. Obtain a USB Serial Adapter f.e. CH340G and wire it up to the SLWF-01, on ESPHome compile the binary and use ‘Plug into this computer’ to upload it through serial port

2 Likes

Oh! I’ve forgotten the OTA update through web interface. Thanks a lot :grin:

1 Like

I recently tried the OTA route but it did not work. I then made a quick programmer using a female USB connector board and a FTDI and simply plugged the dongle into the connector and could program it.

I don’t know why OTA did not work as the same bin file was used with ESPHome Flasher and the module booted just fine.

Hey ,

recently bought some heatpumps (3x A2A running,1x A2W is ordered, 1x A2W is planned).

Found some Modbus Protocoll description for my incoming HW-Unit:

The PCB offers Midea “standards”: XYE, X1X2, PQE besides an integrated Wifi module linked to the famous cloud.

I could imagine, this protocoll is more or similar for all monoblocs.

Some other intresting stuff i found:
My AC units use an “LNS” inteface (230V AC + Signal + Gnd) -
I found an “0-10V to LNS”-Interface, In the end this will mock an indoor unit.

Some AC indoor units also can be retrofitted with XYE & ON/OFF terminals by adding a connection board:

https://www.manualslib.com/manual/2054630/Midea-09.html?page=17#manual

Did you ever have any luck with this?

I too have been investigating trying to get some extra controls back to home assistant. I think ive established the only real way is via the Modbus RS485 connection on the back of the Remote Controller via the H1 and H2 terminals.

I’ve had a few tries and pulling some data from it via an ESP32Dev and RS485 module, but had no luck. I’ve ordered some 120Ohm resistors to put over as a termination end and ill try again.

1 Like

Did you have any luck with comms over the Modbus connection?

I was able to get a Modbus link working to a Pioneer (rebadged Midea - 18K BTU) concealed duct unit using a TTL-RS485 adapter on a ESP8266. I modified the code here: GitHub - rikman122/esp8266_midea_RS485 to work with my 485 adapter (it has auto sense T/R) and my unit, which (as far as I can tell) reports all temps as F.

Based on docs here: xye/xye: Reverse engineered information of protocol spoken on the XYE bus found on many AC indoor components of split VRF systems. Primary vendor seems to be Midea, but others vendors seem to sell rebanded versions (e.g. FrigoLine, Mundo Clima, Daikin, ...) - xye - Codeberg.org I am able to read T1 (intake air) T2 (indoor coil) and T4 (outdoor ambient), as well as fan/mode. However, I really wanted to be able to tap into some of the other settings displayed in diagnostic mode.

Does anyone know how to form a XYE/modbus query to enumerate more settings/sensors? I’ve searched everywhere for documentation, and while there are devices that map these XYE comms to more modbus registers, they don’t document the ‘secret sauce’ of the queries to the unit.

1 Like

Hello,
I have a Clivet heatpump Air to Water which is internally Midea. Im planning to use its Modbus terminals as some people mentioned above:


All the Modbus registers are listed in its Installation manual in Clivet’s page. I havent used ESPhome before and mostly have expirience with ESP32’s IDF stack which im gonna use(it has Modbus module). Just ordered this TTL to RS485 Converter 3.3V/5.0V module.
Could you please give me some advice because i read that some people are already playing with this? What is the voltage of the modbus - can i use the 3.3V signal?

I used that same 485 board to connect to the XYE terminals (proprietary Modbus wrapper protocol), and it worked great. The 3.3v was fine. 485 is a pretty robust standard that can handle like 12V max, >=1V differential signal. I measured the output of my transmitter at around 2.5V signals (on 3.3v power), so it was plenty.

I don’t have the H1/H2 terminals available on my unit. As I understand it, those are conventional modbus (RTU?), whereas the XYE is a poorly-documented (modbus-like) protocol on top of that. They sell units that convert from XYE->Modbus for my unit, but they don’t expose all the status registers (nor do they reveal the XYE translation.)

1 Like

Thanks! Im gonna use the 3V3 interface in this case. I havent used modbus yet but there are very good examples for esp-idf including multi-register requests.

Hello…

Just wanted to share that my mr cool 27k dualhead us mini split works like a champ with these home made dongles and esphome on them…to all out there who are afraid that regular usb does not fit into the strange plug…IT FITS…just needs some effort…worked totally fine with both of my units.
Used this how to and it is just straight forward and works