Support for Midea A/C

I suppose my ultimate goal would be to understand the intermediate steps of how the ESP32 can control the AC unit, agnostic to the agent employed to send the commands. As I studied electrical engineering in my undergrad (no longer work as an engineer, however), I feel a little guilty about just taking a ready made solution without understanding how the “guts” work, if that makes sense?

Try here: reneklootwijk (Rene Klootwijk) / Repositories · GitHub

Nice! I’m sure you’'ll like Home Assistant :slight_smile: And welcome to the community by the way!

ESPHome is a plugin for Home Assistant, however you also could run ESPHome without Home Assistant in for example a docker. The convenience of ESPHome is that you only have to write a YAML configuration and hit the Compile button. So its quite easy to use for those who have limited or no coding skills.

Given this – I kind of like to understand the code that I’m using

I understand and agree, and if you really have the goal to write up a plugin for Homebridge that also would be essential, I see @paddy0174 already pointed you in the right direction. But if I am not mistaken there is a plugin for Homekit that integrates ESPHome devices into it, so you also might want to take a look at that.

Funny thing is, I can’t even get the midea app to connect to my network yet

Do you happen to try to connect it to a 5GHz network? Because that wouldnt work. But you really arent missing out on something, in my opinion the Midea app is a piece of crap…

I’m also wary of “smart” things that need to phone home in order to function. I’d rather maintain direct control within my network.

Fully agree on this, my IoT devices arent even allowed to connect to the internet, except for HA of course.

I feel a little guilty about just taking a ready made solution without understanding how the “guts” work, if that makes sense?

Makes sense, but sometimes its just easier to do so. HA isnt really a ready made solution already, setting everything up the way you want is already a very time consuming job. And to be honest, its never done. (If I speak for myself)

Don’t feel guilty; it has been published on Github and is discussed widely on Telegram.
If it wasn’t mend to be used publicly, they would not have shared it :wink:
But the community is great, and everyone capable tries to assist and contribute :sunglasses:

Discussed on telegram… where may I find these discussions?

By the way, great community, I verily appreciate the replies!

Another lurker here. I’ve read pretty much all of this thread and I’ve also read a good deal of the backlog of the Telegram group. I have 3 Midea units in my house that I would like control over so this seems perfect.

From what I gather I’ll need a ESP32 or Wemos D1 which is probably overkill but they’re cheap enough and I won’t have the OTA update free space issue. Also a level shifter to convert 5v to 3.3v. Then there’s the issue with the usb/not-usb port. I see a bunch of you are making dongles, how are you getting around the USB port issue without modifying the A/C unit itself? Has anyone found a source for these weird connectors or are you modifying regular USB-A connectors?

Anything else I’m missing on the hardware side of things?

I just took a dremmel with a small bit and modified a standart usb-poort connector until it fitted.

My AC does not have the USB port and I simply made a JST to JST cable to fit between my dongle and mainboard. I don’t know if I wouId’ve received a JST to USB connection if I had to buy a stock WiFi dongle.

I have yet to shape the dongle to fit into the stock dongle space.

1 Like

same here…using female usb to jst

I’m using the usual jumper cables you get everywhere. I pulled the USB plug from the PCB and pushed the “female” jumper cables in. Some electrical tape wrapped around - done. :slight_smile:

I desolder the metal outside part of a standard USB male breakout board, pull the contacts out and secure the metal part to my workbench. Put in a flathead screwdriver and push the plastic part out, sand it down so it fits the AC USB port and reassemble the connector.

Ok I have a Dremel so that shouldn’t be too hard. I just noticed that it seems only the mini-split has the weird USB port. My 2 window air conditioners have a regular USB-A female so at least I’ll only need to do this for one of them.

One more question. Any reason I can’t use these?

I’m lazy and I pass by a Microcenter every day.

As long as they accecpt the esphome programming and have tx/rx, i don’t think it will be an issue…esp=esp :wink:

Hi! I was working on my version of the component and found that the climate control works much better with a separate temperature sensor. Are there any plans to add a CustomAPIDevice for a separate temperature (and humidity) sensor?

1 Like

Ok I’m having some trouble here. I’m using an Adafruit ESP32 with an Adafruit TXB0104 level shifter.

This is all I’m getting.

I have

 # UART settings for Midea dongle (required)
 uart:
   tx_pin: GPIO17
   rx_pin: GPIO16
   baud_rate: 9600

in the YAML file. At first I had mistakenly used pins 1 and 3 which was in the example code which according to this is incorrect and that it should be 16 and 17. Still getting nothing. Also tried using some of the other GPIO pins, same deal.

I’m not sure if I have a configuration issue or a hardware one. I tried more than one level shifter, and I’m getting 5V on the HV side and approx 3.3v on the LV side. Sometimes the TX pin coming from the A/C is low (like 2v) but I’m guessing that’s normal when checking a UART pin with a multimeter?

I also tried putting the Midea dongle back in to make sure it wasn’t an issue with the a/c itself but it seems to be fine, and I also tried more than one A/C (I have 3). Not sure what’s going on here and I’m hoping someone might have some insight.

As suggested in the Telegram group, change RX and TX (physically). That should solve the problem. :slight_smile:

If not, please report back.

I think I forgot to mention, but yes I’ve tried it both ways.

I had the same issue and swopping resolved it. After the tx query you should get an rx frame. Check all connections. I had a bad crimp. Check continuity on all cables to the AC?