Midea XYE direct communication

Greetings!

I have spent an ridiculous amount of time getting useable data from my Midea rebranded central-air mini-split air-handler unit (AHU) via its XYE terminal. This project is similar to many others but so far I have not found any direct XYE protocol implementation for Node Red so I thought I should open a thread to share my findings and maybe help someone else. Everything would have come together much faster except I have to use a different CRC calculation then previously mentioned in the XYE protocol references.

I primarily referenced this Codeberg page for the XYE protocol
Beyond that, the AI scraped the internet for any information it could find. :grinning_face:

edit
I should include the make/model of my heat pump. It's a Senville SENDC-24HF with 5kw electric Aux heat. I believe it's a rebranded Midea DLFSABH24XB3.

And I'm also using the KJR-120N 2-wire thermostat (with wifi) that connects to the HA/HB terminals in the AHU.

Hardware Connection

I call it direct XYE comms because I'm not using an ESP or WiFi dongle device but rather a RS485 Ethernet Serial Server (Hexin 2108E) in conjunction with a TCP request node to communicate with my AHU. The Hexin is connected via a db9-screw terminal adapter to the AHU's XYE terminals.

Hexin 2108E to XYE Wiring Connection

Heat Pump XYE Wire Color Hexin 2108E Terminal
X (Data+) White T+/B
Y (Data-) Red T-/A
E (Ground) Shield GND

Hexin 2108E Configuration

Network Settings:

  • IP Address: according to your network

  • Port: 1024 (anything suitable, must match your TCP request node)

  • Mode: TCP Server

Serial Settings:

  • Baud Rate: 4800

  • Data Bits: 8

  • Parity: NONE

  • Stop Bits: 1

Function

The Hexin 2108E acts as an RS-485 to Ethernet bridge, converting between:

  • RS-485 (physical layer to heat pump XYE bus)

  • TCP/IP (network layer to Node-RED or other automation systems)

Notes

  • Shield wire should only be grounded at ONE end (at the Hexin)

  • Use shielded twisted pair cable for best results

  • If communication doesn't work, try swapping X and Y wires (polarity can vary by manufacturer)

  • The XYE bus uses RS-485 at 4800 baud, 8N1 with the XYE protocol


CRC Calculations

As previously hinted at, I have to calculate the CRC a bit differently. I use bytes 1 to n-2 (2nd byte up to and including the 3rd last byte in the packet, query/cmd packet is 16 bytes, reply is 32 bytes). So that’s all the bytes excluding the preamble, CRC & postamble bytes. Once my Query 0xC0 has the proper CRC then the reply packet has useful data. This doesn’t surprise me but this is the first time I’ve see this specific combination of bytes mentioned for Midea XYE CRC calculations. I am surprised though that the AHU replies at all with an incorrect Query CRC. I'm using what I understand is a 8-bit additive inverse checksum or two's complement checksum. So similar to the Codeberg XYE protocol except targeting selective bytes.

let sum = 0;
for (let i = 1; i <= 13; i++) {  // Only bytes 1-13
    sum += frame[i];
}
frame[14] = (255 - (sum % 256) + 1) & 0xFF;

And that's as far as I've come. I thought it best to get this typed out for future reference before I forget the details.

The next step is to capture reply packets for each mode/fan combination to decipher the payload bytes as I've already noticed some more discrepancies with the Codeberg protocol.