Midea branded AC’s with ESPhome (no cloud)

I guess the SLWF-01 comes pre-complied, and tou did not flash it yourself?
Just asking, as I don’t have a clue on what yaml is used on it, so can’t say anything on what works and what shouldn’t :thinking:

You will need to add an IR transmitter to the esp module for that (you can find posts about that here in this thread) :wink:

1 Like

@xye and all else that’s working on the XYE integration. I may have found some useful documentation to (if nothing else) verify some of your findings and possibly identify some of the mystery registers…

I am just starting my research on this project today. I have a Senville ducted mini split that I’d like to power from an esp32. My main board very clearly has XYE terminals right next to the CN40, so I ordered my rs485 to TTL adapter and plan to give it a go later this week.

Just want to share that this does not work (so easy) with the new Midea PortaSplit. I partially disassembled the unit, only to find out that the Wi-Fi Chip is directly soldered to the PCB.

The PCB has space for a USB port, but nothing was soldered to it (and it would not fit due to the case)

1 Like

@topdog360 @exciton I am getting the same errors that you saw above. I’ve tried several different GPIO pins, but I am also running on a ESP32-wroom-32U Devkit board. Not sure if that is the issue. Any other suggestions besides trying other pins?

[23:48:42][W][component:237]: Component midea_xye.climate took a long time for an operation (155 ms).
[23:48:42][W][component:238]: Components should block for at most 30 ms.
[23:48:42][D][uart_debug:114]: <<< AA:C0:00:00:80:00:00:00:00:00:00:00:00:3F:81:55
[23:48:43][D][uart_debug:114]: >>> AA:C0:00:00:80:00:00:00:00:00:00:00:00:3F:81:55

Latest YAML (redacted wifi/other unrelated components)

substitutions:
  name: esphome-web-4ca5c8
  friendly_name: ESPThermostat

esphome:
  name: ${name}
  friendly_name: ${friendly_name}
  min_version: 2024.6.0
  name_add_mac_suffix: false
  project:
    name: esphome.web
    version: dev

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging (but not via UART)
logger:
  baud_rate: 0

# Enable Home Assistant API
api:

# Allow Over-The-Air updates
ota:
- platform: esphome

# Allow provisioning Wi-Fi via serial
# improv_serial:

external_components:
  - source: 
      type: git
      url: https://github.com/exciton/esphome
      ref: dev
    components: [midea_xye]

wifi:
  # Set up a wifi access point
  ap: {}

# In combination with the `ap` this allows the user
# to provision wifi credentials to the device via WiFi AP.
captive_portal:

dashboard_import:
  package_import_url: github://esphome/example-configs/esphome-web/esp32.yaml@main
  import_full_config: true

# Sets up Bluetooth LE (Only on ESP32) to allow the user
# to provision wifi credentials to the device.
esp32_improv:
  authorizer: none

# To have a "next url" for improv serial
web_server:

# UART settings for RS485 covnerter dongle (required)
uart:
  tx_pin: GPIO25
  rx_pin: GPIO26
  baud_rate: 4800
  debug: #If you want to help reverse engineer
    direction: BOTH

# Main settings
climate:
  - platform: midea_xye
    name: Heatpump
    period: 1s                  # Optional. Defaults to 1s
    timeout: 100ms              # Optional. Defaults to 100ms
    beeper: true               # Optional. Beep on commands.
    visual:                     # Optional. Example of visual settings override.
      min_temperature: 17 °C    # min: 17
      max_temperature: 30 °C    # max: 30
      temperature_step: 1.0 °C  # min: 0.5
    # supported_modes:            # Optional. 
    #   - FAN_ONLY
    #   - HEAT_COOL              
    #   - COOL
    #   - HEAT
    #   - DRY
    # custom_fan_modes:           # Optional
    #   - SILENT
    #   - TURBO
    # supported_presets:          # Optional. 
    #   - BOOST
    #   - SLEEP
    # supported_swing_modes:      # Optional
    #   - VERTICAL
    outdoor_temperature:        # Optional. Outdoor temperature sensor
      name: Outside Temp
    temperature_2a:             # Optional. Inside coil temperature
      name: Inside Coil Temp
    temperature_2b:             # Optional. Outside coil temperature
      name: Outside Coil Temp
    current:                    # Optional. Current measurement
      name: Current
    timer_start:                # Optional. On timer duration
      name: Timer Start
    timer_stop:                 # Optional. Off timer duration
      name: Timer Stop
    error_flags:                # Optional.
      name: Error Flags
    protect_flags:              # Optional. 
      name: Protect Flags

Do you see TX and RX lights on your RS485 adapter? Is it an auto flow control model? The code currently only works with auto flow control.

@exciton Dang thanks for the speedy reply!

I have not gotten any LED action, which is odd.

I don’t think it is auto flow model, it is this one: Amazon.com

I’ll try to find an auto flow version to order and maybe document what I am doing better tomorrow.

That one looks the same as mine.

Try swapping TX and RX.

Okay so I tried something different tonight and got some RX blinky lights.

A few notes:

  1. I did not have lights until I gave the ESP32 external power (was trying to run it all off the thermostat 5v power but that didnt have enough juice apparently.
  2. Once I added external power to esp32, I still had no lights until I re-attached the 5v wire (I assumed this was 5v output from the AC so I didnt see a need to connect it).
  3. Once I DID get RX lights, they were very dim, so since my RS485 was rated for 3.3 to 33V I swapped it from the 3.3v ACC to 5V acc.
  4. Now the RX light blinks a solid light as if activity is coming in. BUT, still receiving the exact same error code. Below is a diagram of my wiring.

  1. After writing all of the above, I am still playing with the wires and realized even with my thermostat wiring unplugged completely, the RX light still blinks about once per second, so maybe that is just something to do with how the midea_xye lib is working?

  2. Is it worth me crawling into my hotttt attic and wire directly into the XYE terminals on the board? Below is a couple photos to explain why I decided to try at the wired thermostat wires first. (My wired thermostat goes to the CN40 plug on the main board).

The top blue tag is a spare wire that came with the unit (not used) that shows clearly XYE. This mates up to the thermostat plug (bottom blue tag) which makes me think they include this pig tail in case you have a different unit that you need to manually splice into. OR do you guys think that this thermostat maybe isnt using XYE when plugged into my CN40 main board plug?

And here is a few photos of my main board.



Hi. I ordered and isntalled 2 SLWF-01 pro and they work just fine. Thanks for the help.

1 Like

Great to hear yet another supported model :grin:
Maybe an idea to add it here Midea A/C and ESPHome component - list of all known working models and manufacturers ?

hi, can anyone help with my unit
no communication between esp and ac
is level shifter necessary

If you’re pulling 5V from the unit, you probably need to connect GND on your ESP to the GND on the unit (jump GND to E on your diagram). I believe the grounds are isloated on the RS485 boards.

You should see one RS485 light blink when ESP sends a message (regardless of whether it’s received), and the other light blink when you get a reply (which should be immediately after). If you have one light blinking, you’re half way there.

Might want to check your units are at address 0 (which is what the code expects). There are DIP switches to set the address.

If you have a wired controller, this will be very helpful to reverse engineer the protocol. Once you have it talking, we could set it up to listen to the wired controller commands and responses, then use that to figure out the parts of the protocol that are missing.

1 Like

Hey guys,
my AC was working flawlessly. Unfortunately it doesn’t work anymore. The device wasn’t reachable. Because of this I deleted the device from HA. Now I can see the autodiscovered device, but when I try to add this to HA, I get the following error message:

Keine Verbindung zum ESP möglich. Achte darauf, dass deine YAML-Datei eine Zeile „api:“ enthält.

deepl translated:

No connection to the ESP possible. Make sure that your YAML file contains an “api:” line.

I haven’t changed anything. To I need to reflash the stick?

Best regards :slight_smile:

I believe so…for sure can’t hurt.
Make sure to read about api:

Hey @exciton these are all great suggestions, but I think I already had tried them. The grounds I actually all have tied together on my breadboard, I am just bad at diagrams apparently. I didnt post a pic of the whole breadboard because I had some other IR sensors on there that just made it a confusing mess to see in a pic haha.

I did check the netaddress after your message, thank you for that idea. I think its already set to 0 by default. It was hard to see in my last pics due to the hot glue on top from factory. But here is a close up pic!

BTW, yes I have the KJR-120W wired controller (Senville branded).

I’ll keep tinkering with it this week as I have time. Thanks again!

Hello! I have a Midea window unit and it is working great with esphome.

One thing I just realized is that is doesn’t report when its actually running in anyway.

This that just a limit of the communication with the dongle or something I need to change in my config?

esphome:
  name: midea

esp8266:
  board: esp01

# Enable Home Assistant API
api:
  password: ""

ota:
  password: ""

wifi:
  ssid: !secret
  password: !secret
  use_address: 10.0.20.83
    
# Enable Web server.
web_server:
  port: 80

# Sync time with Home Assistant.
time:
  - platform: homeassistant
    id: homeassistant_time


# 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: false              # Autoconfigure most options.
    beeper: false                # Beep on commands.
    visual:                     # Optional. Example of visual settings override.
      min_temperature: 17 °C    # min: 17
      max_temperature: 30 °C    # max: 30
      temperature_step: 1 °C  # min: 0.5
    supported_modes:            # All capabilities in this section detected by autoconf.
      - FAN_ONLY                # This capability is always used.
      - COOL
      - DRY
    custom_fan_modes:
      - SILENT
      - TURBO
    supported_presets:          # All capabilities in this section detected by autoconf.
      - ECO
      - BOOST
      - SLEEP                   # This capability is always used.
    supported_swing_modes:
      - VERTICAL                # This capability is always used.
    outdoor_temperature:        # Optional. Outdoor temperature sensor (may display incorrect values after long inactivity).
      name: Temp

Did anyone ever figure out what connector type that ‘usb with extra bits’ connector is?

My Dremel skills are… lacking. I don’t want to modify the minisplit itself. And I’m having a very difficult time finding USB connectors that can be disassembled to get e.g. a soldering iron in there.

yup, it is this one
122f47220dcc1547196f57708af07c8913e9054f

I honestly don’t have a clue how they are called or where to find…

Luckily. mine also had a header plug which is easy to find :grin:


You can even use ordinary male-male dupont wires :grin:

if it doesn’t have the header plug i guess the ‘easiest’ is to just solder the wires directly on the print board, as few others did :thinking:

or…just do it…like this guy, just with a sharp knife

Hi @petikeje

I am just trying to build my wifi dongle for my midea clone and struggling with the uncommon usb lookalike connector.
You are referring to delock. Can you be a little more specific, please?
(obviously anyone is welcome to answer)

thank you