Midea branded AC’s with ESPhome (no cloud)

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

:rofl:

Does it mean just a small hammer, and all fits?

Nope regular pushing works…

Can anybody tell/show the wiring scheme for this? I have already burned one, so I’m trying not to repeat the magic

@tmsaavedra you have to provide a bit more info…
wiring what to what and why???

I put reply on the post but it no made the quote, sorry.

The help I need is about conecting the SWLF-01 to the programmer to flash it, I flashed it via OTA but can’t find it anywhere, the config is correct since it’s the same as other one I used on another dongle.

Hmm…can’t really help here, should be a mix of the wiring I showed in the 1st topic and the picture provided by manufacturer


But, using gpio4/5 instead (i guess)
Note you need to keep the ‘flash’ button pushed while powering up to get into flashing mode (in contradiction of my esp01 that requires ‘IO0’ and ‘EN’)

Thanks anyway @aceindy , I sent a pm to @iamvlanone, lets see if he can help based on what he did on his reply above ( this )

1 Like

Hi, i have a problem setting follow me feature in my Midea AC with dongle.

I have soldered dongle with board with 1 wire. Button, swing seems working right. I can’t handle the follow me feature. It seems i’m missing something.

my config in esphome

esphome:
  name: kaisai
  platform: ESP8266
  board: esp12e

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  use_address: kaisai.local
  manual_ip:
    static_ip: 192.168.0.19
    gateway: 192.168.0.1
    subnet: 255.255.255.0
    dns1: 1.1.1.1
    dns2: 8.8.8.8

  ap:
    ssid: "midea-open-dongle"
    password: "123456789"

captive_portal:

# Enable Home Assistant API
api:

ota:

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

# UART settings for Midea dongle (required)
uart:
  tx_pin: 1
  rx_pin: 3
  baud_rate: 9600
  
# Main settings
climate:
  - platform: midea
    name: "Kaisai AC"
    period: 1s  
    timeout: 2s
    num_attempts: 3
    autoconf: true              
    beeper: false               
    visual:                      
      min_temperature: 17 °C     
      max_temperature: 30 °C     
      temperature_step: 1 °C     
    outdoor_temperature:        
      name: Temp na zewnątrz

remote_transmitter:
  pin: GPIO13
  carrier_duty_percent: 100%

sensor:
  - platform: homeassistant
    id: follow_me_sensor
    entity_id: sensor.salon_ble_temperatura
    filters:
      - throttle: 10s
      - heartbeat: 2min       
      - debounce: 1s
    on_value:
      midea_ac.follow_me:
        temperature: !lambda "return x;"
        beeper: false
  - platform: wifi_signal
    name: Kaisai AC RSSI
    update_interval: 60s

button:
  - platform: template
    name: Display Toggle
    icon: mdi:theme-light-dark
    on_press:
      midea_ac.display_toggle:
  - platform: template
    name: Swing Step
    icon: mdi:tailwind
    on_press:
      midea_ac.swing_step:
      
switch:
  - platform: template
    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:

any ideas? What Am i missing?

Hi @Stormhand, did you managed to control the unit with Modbus protocol? I have a Clivet heatpump Air and i would like to try to control it with the same method. I own this unit: Clivet Sphera Evo 2.0 and as you, i found the complete table of parameters in the instruction manual. I haven’t bought anything yet. I hope that you can give me some suggestions

Hi @cash18 i just received the module but havent tested it yet. I have to solve the problem how to pull a cable from an external building where the pump controller is mounted. Otherwise i cant test it.