Midea branded AC’s with ESPhome (no cloud)

My issue was a bit different, I’m controlling this over ESPHome / UART:
If I remember correctly, the unit defaults to turning on in COOL mode. I turned it on using an automation (which sets climate.turn_on then a 1 hour timer before turning it off) to turn it on (expecting it to remember the previous mode) and it correctly turned on COOL. Then a few days later it was cold out and I manually used the heat mode. After that, I used the automation again and it while I would have assumed it would have gone to the previous mode, it turned on the COOL mode.

So it seems like it’s defaulting to COOL regardless of previous run mode. It’s not the end of the world, just not what I would have expected.

Of course I can’t find the exact reference now, but it was a link to a .txt file in one of the Github Issues/PRs to either the Midea AC LAN repo or its active fork(s)

I was just hoping the UART protocol would provide some hints to magic byte values in the XYE protocol, but the protocol appears totally different.

XYE does appear to be pretty limited, as would be expected with its intended use with the Central Controllers. The commercial devices that adapt XYE to Modbus/BACNet/etc don’t appear to offer any settings/sensor values that we don’t already know based on the codeberg.org repo.

Hi,

I have a Bosch Climate 5000 system, currently using SWLF01 to control the ductless head and SmartIR/Broadlink to control the ducted. I am looking to add FollowMe to the ducted configuration for better temperature control.

Is it possible to interface a second SWLF01 to the ducted unit to replace the SmartIR/Broadlink setup? I have CN9 XYE, CN40 4-wire controller and CN10 Display Board/Wire controller interfaces available.

Thanks!

Usually the ducted Midea/Midea-white-label units require an adapter device to work with the ‘USB-like’ Wifi modules. Typically, these plug into the CN40 connector. Here’s Pioneer’s version: Pioneer Smart-WiFi Wired Wall Thermostat Kit for CYB, UYB, and RYB sys

I’m not clear on what your goal is, however. If you have an IR transmitter for the ducted unit (aimed at the built-in receiver on the CN10 display board), you could just send the follow me temp through that.

If that transmitter setup doesn’t support arbitrary IR codes, an ESP8266 or ESP32 with an IR LED and ESPHome’s IR Climate component can send Midea IR commands including follow me.

Thanks Brian - I appreciate the insight.

I wasn’t aware of the IR Climate component or Follow Me capability but I set this up with an ESP 32/IR LED tied to a room temp sensor. Early days, but it appears to control the room temperature much better than my old setup (SmartIR/Broadlink RM Mini providing control, with temperature sensed by the unit itself). This is despite testing with various temperature compensation DIP switch settings.

Thanks again – Peter

Hi All,

I think I am onto something but will need help to confirm. I’ve been reading this post with a lot of interest and I have been putting the puzzle pieces together from posts in this thread.

All of the Midea/Rebranded Midea aircons that has a display board with the 5 pin usb connector unpopulated.
image

The CN3 connector has the following pins (GND, 5V, TX, REC, 5V/NC depending on model). The TX and REC pins will be shorted together with a 0Ω link. To find this link, follow the send pin (purple dot) of the IR receiver (circled in red) to the CN3 pins. Remove that link and yes, your IR will be dead if you don’t have the USB board plugged in. Also check that the pin next to the ground pin of CN3 has 5V on it. If not follow the outer pin to where there is a open jumper that needs to be bridged.

Plug in your usb adapter board and ESPhome dongle and you are off to the races.

image

This is where things get interesting though and I will need someone to confirm my theory.

image

My theory is: The usb breakout board is just a micro controller that converts the serial inputs from the ESPhome dongle to infrared signals and it effectively man in the middles the IR receiver. Hence the reason for the IR not working when the board is unplugged and the jumper on the boards that does not have the C3 connector populated from factory.

Therefore, I believe we do not need the external board and we can get do the following even with the current ESPhome dongles with just a minor software update.

  1. Create a database of all of the IR signals and a method of sending them out. I believe this has already been done in the ESPhome midea IR remote.
  2. Read the IR signal onto a buffer and echo it back out on the return pin.
  3. Be able to send the captured database signals over the return pin
  4. All this implemented in an update for the Midea ESPhome module.
  5. We have full feedback with even the option of follow me etc.

This means that we could even make it work with any Midea/rebranded midea aircon that has the 10 pin CN1 connector as the first 3 pins are GND, 5V and the IR signal. Where we just make a jumper harness that man in the middle the CN1 connector. EG intercept the red wire and make most midea/clones smart.

To confirm my theory can someone with the USB breakout board measure the signals on the CN1 connector between GND (black wire) and rec pin (red wire) when controlling it with the IR remote and with the ESPhome dongle.

Unfortunately, I do not have access to a aircon where I can test my theory.

Thank you in advance for your help.
AB

@Ghost_in_the_wires I think you have a flaw here, you will not have any feedback…
F.e. if you switch on the a/c with the remote, the esp will not know it was turned on…accordingly HA will not be updated….

@aceindy Unfortunately I currently don’t have access to a unit to confirm my theory… however I do believe the wifi expansion board is nothing more than a glorified serial to IR translator. It man in the middles the IR signal coming from the display board and echoes the incoming signal back out to the display board and translates it into serial for the usb dongle attached. That same micro is on the display boards with only 4 pin usb connectors.
I am 99% confident that if you probe the TX and REC lines with a logic analyser or oscilloscope you will find a simple IR transmission when you use the aircon remote. I am also confident that you will find the same IR transmission when you use the USB dongle.

image

Therefore, if we replicate that functionality in the ESP dongle… e.g. repurposes the RX and TX lines on the usb dongle to read the IR signal on the 5 pin CN3 connector and echo the IR signal back out to the display board. We will know what was sent and will be able to update the state.

This will be the same for the display boards that only have the CN1 connector with 10 wires as we will do the same with the IR signal going out on the red wire on that connector.

This will be the same for the display boards that only have the CN1 connector with 10 wires as we will do the same with the IR signal going out on the red wire on that connector. e.g intercept and retransmit so that we know the state of the aircon when the remote is used.

This is just a hard-wired version of the esphome midea IR remote. Where that is using another ir receiver to receive and update home assistant and for control it transmits out over IR.

I hope it makes sense what I am proposing.

With the remote, you will send commands TO the A/C, but the remote does NOT receive signals back about the status…this in contradiction to the USB dongle; it utilizes both TX and AND RX…
So when I turn on my A/C with the remote (or change the temperature), the status will be updated on the USB (and app or HA).

But when I turn on my A/C with HA (or app), the status of the remote remains unchanged…

@aceindy I think that I didn’t explain my train of thought clearly as to why I think it should work re the board still getting the signals. I’ve analysed the circuit and my conclusions were as follows:

On a board that does not have the CN3 connector populated. The CN3, TX and REC pins are shorted which is connected to CN1 the red wire. Therefore, the signal received by the REC1 IR receiver is sent directly to the main board of the aircon.
image

To enable the board to work as per Epikarus post.

You need to remove the bridge of the REC and TC pins caused by J3 from the board and short another link to get 5v onto the CN3 connector. Once this is done your IR sensor will not work unless you have this module plugged in:
image

Once this is done, you can control the aircon with a esphome dongle.

This is what leads me to believe that the chip circled in yellow on the display boards with the 4pin connector usb connector does the same function as the stand-alone board in the image above. If you follow the traces on that board, I would be confident that you will find that the usb connector and the IR receiver will connect to that IC and that it connects to the CN1 connector pin 3 (red wire) that goes to the main aircon board.

image

Thus, my hypotheses that the external usb connector board CE-26GY-2.4G 17122000046741 is just a microcontroller that intercepts the output signal of REC1 and echos it back out to the display board and to the connected usb dongle listening on uart. The diagrams below show my interpretation of the signal flows for both the non-usb and usb versions of the aircon.

image

My proposal signal flow diagram where the esphome module intercepts the signal between the display board and the main board can be seen below:
image

In this position you are able to intercept the IR signal from the display board and to retransmit it to the main board. You will also be able to inject the required signals from the esphome module directly to the main board. Therefore, you will know the status as you intercepted the signal from the display board and just retransmitted it. Therefore, we will be able to get full control of the system even if it just has the 10 wire CN1 connection.

My theory can be easily proven by reading the signal on the red wire of CN1 when the aircon is turned on by the ir remote and when turned on using the esphome dongle. Both of these should just be a raw IR signal.

I hope this has clarified what I am proposing and how I believe the system to function. Can someone who has access to the system and happy to play with it check and share the signals for my test above?

Sorry @dydx, I didnt check that thread recently with the holidays. Did you figure it out or you need me to take more pictures?

Thank you! I was wasted a few hours getting no response before I found this. This was also my issue.

Glad you got it working. I noticed the same: a reliable ‘follow me’ IR message based on a temp sensor in the room I’m occupying results in a reasonably-close temp vs setpoint. I also could never get the temp sensed at the intake (T1, default without follow me) to work very well, and the DIP switches are not respected.

If you go down the rabbit hole I have with trying to get the setpoint delta as small as possible, a helpful tip is that the algorithm appears to use the setpoint delta (setpoint - measured temp) and running time as the basis of its ‘smart’ algorithm. Even if your unit works in Fahrenheit, the control loop appears to use Celsius. The unit will only ramp up compressor power if the setpoint delta is +2C (heating) / -2C (cooling) for a few minutes. Otherwise, it will happily run with a ±1C delta at low power indefinitely. That maps to 2F, so if you aren’t comfortable with a ±2F delta, you’ll need to adjust the temp you feed it via IR to tighten that control loop.

Hello
Is this integration could work with a Comfee MDDN-12DEN7 dehumidifier

hello to everyone
is my first time here , Need help with my air conditioner Model: AR18TXHQASIN
S/N:BDE2P8DN700553V
YEAR:2020
please
can someone help me beacuse mine come without wifi

@freddy90 It looks like you are in with a good chance of it working as it looks like you are just missing a esphome dongle and the female usb to 4 pin connector circled in red.
image

you can even do a direct connection to the white connector from a wemos D1 mini with a level shifter.

refer to this post

Hello,

This Display panel CN1 connection:

R/T +5V GND +5V TXD RXD

Is not usable ???

Sorry my Midea Clone is not installed, no testing…

@Akee - i think you should just solder the dongle directly to the UART Port (CN3) or get an adapter from the web. The port seems to be populated on your board and connected to the processor of the display board. Please read the thread here to get an understanding what you are doing :slight_smile: (The USB port is not a real usb port, just a serial port that communicates telegrams with the connected dongle …)

@brianHa I have some news!

I am currently analyzing me session from today, got a lot of packets but it seems the follow me packet looks like this and is transmitted every ~30sec from the wall controller
Wall remote:
image

Reply by unit:

Further oberservations: when i enter the query mode on the remote control (where the unit shows temperature, frequency on the display), it seems that there is no initial command, just the query of the datafield is sent to the wall-unit and the display show & updates the value.

image

Interesting is the following observation: when i unplug the communication cable from the AC to the multifunction control board (converter from r/t pin to XYE bus; CN40-CN1 // CN43 is just power 12V/GND), the display does not enter the error state (which happens when the bus-pins of XYE disconnect, but the power is connected to display)
This means the frequent XYE communication is just on the bus and the adapter pcb is not just a converter for constant communication. The Multifunction Control Board fully drives the XYE bus and seems to only forward some commands to the display board. Maybe the XYE bus is translated to RC-like? or some else commands for transmission over R/T pin (CN40-CN1 is 3 wires with bidirectional R/Tpin; 5V and GND)

I currently do not have the time do dig deeper, but if i find some time i would solder a logic analyzer directly to CN1, CN2, IR Rec, IR Transmit and R/T pin for a full scale investigation :slight_smile:
Currently i am unsure, why midea should limit commands from the CN3 connector but allow full communication on CN1-R/T Pin? … but if there are limitations, maybe for some use-cases a new softwaredriver for the ESP-Home+R/T pin on CN1 can make the IR transmitter superfluous. (directly solderable)
I am on the way to buy another unit - this time for my home-office. Which then means full access 24/7 :wink:

Perhaps a bit late, but this is the PCB for the ACiQ branded version of KJR-120W/MBF:

Can’t post more than one image due to new user :\

Very interesting. So now XYE has 6 different command bytes that I (we) know of:

0xC0 - primary query
0xC3 - primary set
0xC4 - set celsius mode (exciton found)
0xC6 - thermostat temp a.k.a. follow me
0xCC - lock
0xCD - unlock

I’m not sure I can make sense of the relevant bytes of that payload, however. They look to be
0x06 - ???
0x13 - or 19 in decimal, 19C/66F ??

Does it sound reasonable that your thermostat was reporting a temp of 66F (19C)? For the IR remote, if the unit is Fahrenheit based, the follow me temp is (TempF - 31), but that would be 56F/13C, which seems less likely unless you like it cold.

Does your unit work in F or C temps? Also, what model wall controller (4-wire) do you have?

That does seem to support a couple of things:

  • The 4-wire protocol used by the more modern thermostats is XYE/CCM protocol, not modbus, IR-over-wire, or UART
  • Midea extended the XYE/CCM protocol with additional command bytes/payloads that aren’t well-documented by the original XYE dissection from a CCM controller
  • I haven’t found any obvious overlap between the UART, IR, and XYE protocols in terms of magic bytes or packet layout
1 Like