Midea A/C via local XYE

@CWood thank you for repo! This was a huge time saver for deploying on the latest ESPHome.

One issue I am having though: The ESP32 doesn’t automatically start querying heat pump status. I have to switch to “Fan only” mode using the Climate entity that this integration creates. That seems to kick start the esp32 into working and continually monitoring status.

And then if I attempt to change the target temp in heat mode, the command works and the heat pump gets the command, however the esp32 will again quit querying status every second. Any pointers?

[11:35:59][D][climate:426]: 'Heatpump' - Sending state:
[11:35:59][D][climate:429]:   Mode: HEAT
[11:35:59][D][climate:431]:   Action: HEATING
[11:35:59][D][climate:434]:   Fan Mode: AUTO
[11:35:59][D][climate:449]:   Current Temperature: 19.50°C
[11:35:59][D][climate:456]:   Target Temperature: 17.22°C
[11:35:59][D][uart_debug:113]: <<< AA:C0:00:00:00:00:30:14:84:84:11:4F:4E:8A:38:FF:00:00:00:00:00:00:00:00:00:00:00:00:E0:01:A4:55
[11:36:00][D][uart_debug:113]: >>> AA:C4:00:00:00:00:00:00:00:00:00:00:00:3B:01:55
[11:36:00][I][midea_xye:448]: DEBUG C4: AA:C4:00:00:00:00:00:00:80:30:8C:00:00:00:00:00:84:80:C6:BC:D6:36:00:00:00:00:80:80:80:80:6E:55
[11:36:00][D][uart_debug:113]: <<< AA:C4:00:00:00:00:00:00:80:30:8C:00:00:00:00:00:84:80:C6:BC:D6:36:00:00:00:00:80:80:80:80:6E:55
[11:36:01][D][uart_debug:113]: >>> AA:C0:00:00:00:00:00:00:00:00:00:00:00:3F:01:55
[11:36:01][D][climate:426]: 'Heatpump' - Sending state:
[11:36:01][D][climate:429]:   Mode: HEAT
[11:36:01][D][climate:431]:   Action: HEATING
[11:36:01][D][climate:434]:   Fan Mode: AUTO
[11:36:01][D][climate:449]:   Current Temperature: 19.50°C
[11:36:01][D][climate:456]:   Target Temperature: 17.22°C
[11:36:01][D][sensor:135]: 'Inside Coil Outlet Temp': Sending state 48.50000 °C with 1 decimals of accuracy
[11:36:01][D][uart_debug:113]: <<< AA:C0:00:00:00:00:30:14:84:84:11:4F:4E:89:38:FF:00:00:00:00:00:00:00:00:00:00:00:00:E0:01:A5:55
[11:36:02][D][climate:048]: 'Heatpump' - Setting
[11:36:02][D][climate:077]:   Target Temperature: 19.44
[11:36:02][D][climate:426]: 'Heatpump' - Sending state:
[11:36:02][D][climate:429]:   Mode: HEAT
[11:36:02][D][climate:431]:   Action: HEATING
[11:36:02][D][climate:434]:   Fan Mode: AUTO
[11:36:02][D][climate:449]:   Current Temperature: 19.50°C
[11:36:02][D][climate:456]:   Target Temperature: 19.44°C
[11:36:02][D][uart_debug:113]: >>> AA:C4:00:00:00:00:00:00:00:00:00:00:00:3B:01:55
[11:36:02][D][climate:426]: 'Heatpump' - Sending state:
[11:36:02][D][climate:429]:   Mode: HEAT
[11:36:02][D][climate:431]:   Action: HEATING
[11:36:02][D][climate:434]:   Fan Mode: AUTO
[11:36:02][D][climate:449]:   Current Temperature: 19.50°C
[11:36:02][D][climate:456]:   Target Temperature: 17.22°C
[11:36:02][I][midea_xye:448]: DEBUG C4: AA:C4:00:00:00:00:00:00:80:30:8C:00:00:00:00:00:84:80:C6:BC:D6:36:00:00:00:00:80:80:80:80:6E:55
[11:36:02][D][uart_debug:113]: <<< AA:C4:00:00:00:00:00:00:80:30:8C:00:00:00:00:00:84:80:C6:BC:D6:36:00:00:00:00:80:80:80:80:6E:55
[11:36:03][D][uart_debug:113]: >>> AA:C3:00:00:00:00:84:80:C6:00:00:00:00:3C:37:55
[11:36:03][D][uart_debug:113]: <<< AA:C3:00:00:00:00:30:14:84:84:11:4F:4E:89:38:FF:00:00:00:00:00:00:00:00:00:00:00:00:E0:01:A2:55

For completeness, the wall controller wiring I’ve seen is:

  • Brown: RS485 A
  • Yellow: RS485 B
  • White or Black: GND
  • Red: 12V

The M5 Atom/Tail 485 requires a 4 wire wall controller. I’m guessing that 2 wire HA/HB uses the same serial protocol, but I don’t know the electrical characteristics. An oscilloscope trace of HA/HB would help to figure that out. Then it would be possible to design an interface.

Otherwise look in the indoor unit / air handler to see if it has CCM / XYE / RS485 terminals. This is also RS485, but only supports a subset of features.

In terms of monitoring, on my system XYE can still see indoor ambient, indoor coil and outdoor coil temp. But the outdoor ambient temp can’t be queried on this bus (at least not in the same way).

I haven’t figured out how to observe other parameters such as outdoor fan speed, compressor speed, electronic expansion valve angle. Sniffing the bus between indoor & outdoor may be enlightening.

Either find 12V for the fourth wire on the RS485 interface, or 5V which can directly power the main M5 Atom module.

None of those brands exist in my country. But it doesn’t mean much, they’re all made by Midea and closely related.

Thanks so much for this. I’ve been away for some time, and just discovered yesterday that the code is broken post 2025.11… I was just going to start working on the changes. I’ll try and incorporate your changeset and update my “delays” branch which is what I’ve been running for months (I had 125 days uptime before I restarted it recently…)

I’ll also try and catch up on this thread a bit when I get some time.

-Matt

Updated GitHub: GitHub - mdrobnak/esphome at delays_updated

In YAML, you can use

external_components:
  - source: github://mdrobnak/esphome@delays_updated
    components: [midea_xye]
    refresh: 0s

for the time being. I’m not 100% done yet, and I have a deprecation warning to fix. But I’m looking over Climate Entity Class: FiniteSetMask and Flash Storage Optimizations - ESPHome Developer Documentation and trying to incorporate all of the changes listed there to future proof this some more.

I think at some point once it’s stable, this just wants to be a “protocol” option for the midea_ac class. Serial UART for that + IR, or XYE.

-Matt

Here’s an example: Ali Express

As is typical with Ali, it’s not clear if the model is an official Midea unit or a clone, or if it really matters. You can also try searching for ‘Midea AC Fault Tester’ or ‘Midea 485 Tester’ on AliExpress.

In the US, Carrier rebadges Midea splits, so they have this tool under their catalog as well, part num: 17222000A55927 It is sometimes referred to as a ‘Dr Smart Inverter Diagnostic Tool’. Searching for that or the model number should bring up some English details/US suppliers. Here’s a video of basic operation: https://www.youtube.com/watch?v=UgYZLTLlXqM

@mdrobnak I noticed that the current temp reported in HA jumps up to 120F when I change modes. Is this only meant to work in follow me mode, or can I use it to control my TL04 thermostat?

Huge thanks for all of the heavy lifting in this thread building out the XYE interface. I have some debugging to share.

ACiQ (Midea) 6 zone condenser with 4 wall mounted heads (USB ESP32 interfaces) and a 24K concealed duct AHU which I have a M5stack Atom + Tail485 wired into successfully on the XYE terminals. I do also have a KJR-120N wired into separate AB/AH terminals. I do also have the wifi on the KJR-120N configured with the Midea AC LAN integration in HA. Goal is to get away from this integration and use XYE exclusively for control and debugging.

  • XYE component always reports a 120F set point (and will go back to this if manually changed)
  • No idea where the current temp of 52.5F is coming from
  • I can trigger mode changes via XYE and see that reflected on the wall controller
  • I don’t not believe the coil temps are correct and I know the outside temp is incorrect (currently 50F-ish)


Debug logs: homeassistant/XYE/living-room/logs_livingroom-hvac_run.txt at 9e7b2dfdde197b73b3ad828f48b1544cd8e0c424 · dadcoachengineer/homeassistant · GitHub
Full config: homeassistant/XYE/living-room/yaml at 9e7b2dfdde197b73b3ad828f48b1544cd8e0c424 · dadcoachengineer/homeassistant · GitHub

Hello, I am geting a new Midea EVox system which a heat pump with an indoor air handler and backup heat via heating element. I have confirmed that I can read data from the XYE port from the motherboard in the indoor unit. Where is the latest code of this component that implements “Follow Me” not using IR ?

Can you elaborate? What is the actual command via UART that is “FollowMe” for you?

Ok, I see that this is the code, but what repo/bracnh contains it?

In YAML, you can use

external_components:
  - source: github://mdrobnak/esphome@delays_updated
    components: [midea_xye]
    refresh: 0s

(See post a little bit above for the full github link)

So far this code is ok.

The AA C6 command is what sets follow-me.

@aeozyalcin what is the TL04? Not sure what you mean here.

The only thing I Have is the ESP32 + sensors around thehouse which feed into HA and that’s used for follow-me for the hallway during the day, and bedroom at night. No other thermostat. I have a 24V thermostat on the wall looking pretty and doing nothing lol.

-Matt

I will put in the masking out of 0x40 into a branch and see if that helps things and doesn’t break my unit :slight_smile:

I’ll look over those logs when I get some more time. Unfortunately not tonight.

-Matt

Happy to report that the delays_updated branch works for me on a brand new Midea Evox system:

I use a m5 Atom ESP with an m5 Atom RS485 base and hardware wise was very simply to install using a Cat6 wire.

I think he means the smart thermostat that controls the Midea system via HB/HA connection (replaces the 24V thermostat connection)

Ah, I see. OK. If you have something on HA/HB, and the CN40 / XYE / RS-485 connection, they well communicate with each other and not step on things, as far as I can tell. This is similar to how the WiFi dongle works.

So, in theory, if you change the temp on the TL04, it should show up in home assistant, and vice versa. But, that’s theory, as I don’t have my HA/HB version of the thermostat anymore unfortunately.

-Matt

This is true, I see it in my system.
The follow me feature however does seems to interfere each other.

Hello hackers, I had to update the code a little bit as the reading for my target temperature happens in the C0 Frame and not in the C4 frame.
You will notice this problem if you change the target temp but the hass climate device reads another target.
Here is the link to the component with my fix:

external_components:
  - source: github://HomeOps/[email protected]
    components: [midea_xye]
    refresh: 0s

Release: Release Set target temp during Query frame and not the Extended query frame · HomeOps/ESPHome-Midea-XYE · GitHub

This makes sense. As both would be sending the AA C6 frame.

As far as your C0 vs C4 issue, I may revert it back to C0.

-Matt

Midea EVOX Ducted Integration with ESPHome: Lessons Learned and Next Steps

I’ve been working on integrating my Midea EVOX ducted heat pump system (model QS003I-3Hen AHU, 24V) with ESPHome and wanted to share some findings that might help others tackling similar setups.

:brain: System Overview

  • Indoor Unit: Accepts IR commands directly and also via the M-Station

Installation was straightforward, and the hardware is inexpensive. Once wired up, I began exploring how the system behaves when the M-Station is disconnected.

:magnifying_glass_tilted_left: Key Discoveries

  1. M-Station = Brain of the System Disconnecting the M-Station disables scheduling and presets. It also removes conflicts with Follow Me IR frames. Critically, the XYE protocol never sends “AUTO” mode—it only reports heat or cool. This confirms that AUTO logic, presets, and scheduling are implemented inside the M-Station, not the AHU or ESPHome.
  2. Fan Mode Limitations While the system can send fan mode commands, it never reports back the fan state. The C0 frame remains unchanged, however the “Send” command does work.
  3. Follow Me = Efficiency Booster Sending Follow Me frames directly from ESPHome allows the unit to receive real-time target temperatures. Unlike thermostats like EcoBee—which only send stage commands (e.g., heat stage 1/2)—Follow Me gives the unit the actual temperature delta. This enables the inverter to calculate the optimal ramp speed and duration. My Home Assistant temperature closely tracks the unit’s internal target when the thermostat is disconnected, validating this approach.

:hammer_and_wrench: Next Steps

  • Virtual AUTO Mode: I’m building an ESPHome virtual climate device that mimics thermostat logic—handling heat/cool switching, target temp, fan mode, and presets.
  • Custom YAML Blueprint: Planning to publish a tailored YAML config for ducted heat pump users, so others can benefit from a plug-and-play setup.

If anyone else is working with Midea EVOX or similar RS-485 setups, I’d love to collaborate or compare notes. The goal is to make these systems smarter, more efficient, and fully integrated into Home Assistant.

Let me know what you think or if you want to test the virtual AUTO logic once it’s ready!