Midea branded AC’s with ESPhome (no cloud)

@paddy0174 That’s weird…it compiles fine here:

INFO Reading configuration /config/esphome/Midea-hvac.yaml...
INFO Generating C++ source...
INFO Compiling app...
INFO Running:  platformio run -d /config/esphome/mideahvac
Please wait while upgrading PlatformIO...
PlatformIO has been successfully upgraded to 5.0.1!

********************************************************************************
If you like PlatformIO, please:
- follow us on Twitter to stay up-to-date on the latest project news > https://twitter.com/PlatformIO_Org
- star it on GitHub > https://github.com/platformio/platformio
- try PlatformIO IDE for embedded development > https://platformio.org/platformio-ide
********************************************************************************

Processing mideahvac (board: esp01_1m; framework: arduino; platform: [email protected])
--------------------------------------------------------------------------------
Tool Manager: Installing platformio/tool-scons @ ~4.40001.0
Tool Manager: tool-scons @ 4.40001.0 has been installed!
Tool Manager: Removing tool-scons @ 3.30102.0
Tool Manager: tool-scons @ 3.30102.0 has been removed!
HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 3.20704.0 (2.7.4) 
 - tool-esptool 1.413.0 (4.13) 
 - tool-esptoolpy 1.20800.0 (2.8.0) 
 - toolchain-xtensa 2.40802.200502 (4.8.2)
Library Manager: Installing Update
Library Manager: Already installed, built-in library
Dependency Graph
|-- <ESPAsyncTCP-esphome> 1.2.3
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESPAsyncWebServer-esphome> 1.2.7
|   |-- <ESPAsyncTCP-esphome> 1.2.3
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <Hash> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
Compiling /data/mideahvac/.pioenvs/mideahvac/src/esphome/components/midea_ac/midea_climate.cpp.o
Compiling /data/mideahvac/.pioenvs/mideahvac/src/esphome/components/midea_ac/midea_frame.cpp.o
Compiling /data/mideahvac/.pioenvs/mideahvac/src/esphome/components/midea_dongle/midea_dongle.cpp.o
Compiling /data/mideahvac/.pioenvs/mideahvac/src/esphome/components/midea_dongle/midea_frame.cpp.o
Compiling /data/mideahvac/.pioenvs/mideahvac/src/main.cpp.o
Linking /data/mideahvac/.pioenvs/mideahvac/firmware.elf
Building /data/mideahvac/.pioenvs/mideahvac/firmware.bin
Retrieving maximum program size /data/mideahvac/.pioenvs/mideahvac/firmware.elf
Checking size /data/mideahvac/.pioenvs/mideahvac/firmware.elf
RAM:   [=====     ]  45.2% (used 37064 bytes from 81920 bytes)
Flash: [====      ]  40.1% (used 411128 bytes from 1023984 bytes)
Creating BIN file "/data/mideahvac/.pioenvs/mideahvac/firmware.bin" using "/root/.platformio/packages/framework-arduinoespressif8266/bootloaders/eboot/eboot.elf" and "/data/mideahvac/.pioenvs/mideahvac/firmware.elf"
========================= [SUCCESS] Took 8.98 seconds =========================
INFO Successfully compiled program.

I only can’t upload it OTA:

ERROR Error binary size: Error: ESP does not have enough space to store OTA file. Please try flashing a minimal firmware (remove everything except ota)

However, I can download the bin, and then flash it by USB using ESPFlasher

The board I have looks similar, however, if I disconnect the cable to the Wifi module USB port, my indoor unit stops responding to the IR remote. So I dont think you can just solder on a port, the IR receiver is on the PCB with the LED display. The USB port module that I have looks similar to the one @yodi has. I also have the USB A port with the cuts.

@yodi did you have any success yet ?

Here are some pictures:



My system is an Inventor Multisplit with AR2MVI-12WiFi indoor units. The WiFi module that came with it is the EU-OSK103.

@nvschilleman, No sorry I’ve not had time to play with this yet, plan is to setup the serial bridge / uart sniffer from https://github.com/reneklootwijk to get a better view of what is being transmitted, but indeed our units looks very similar.

@bartlebi Do you have the wifi board as shown in nvschilleman’s 3rd picture? I think you’ll need that in order to enable wifi…
@nvschilleman The left connector on the wifi board goes to ?? CN3 on the display board ??

1 Like

@nvschilleman Thanks for your photos. It is strange, and is not clear for me how the IrDA and the Wi-Fi module are related. Am i right that you already had a board for connecting USB devices when you bought it, and after you bought only the Wi-Fi module itself?

I wrote to the service of the air conditioner brand with this question, they replied that simply unsoldering the connector on the board or replacing the display board with one with an indication and a connector will give nothing, since the presence of a wifi is not programmed in the main unit of the air conditioner and it simply will not work …

@yodi Okay! I ordered some ESP-01’s yesterday. When those arrive I’ll also give it a shot and post my progress in this topic.

@aceindy The left connector on the wifi board goes to CN3 on the display board.

@bartlebi, yes it is indeed strange, when I connect the WIFI board the LED on this board stars blinking a few times, also when there is no WIFI module plugged into the USB port of the WIFI board. When it stops blinking my IR remote works again…

What make/model is your air conditioner?

@nvschilleman I have 2 Lessar LS-H09KPA2/LU-H09KPA2.

I think our indoor units are almost identical, you might be able to swap the circuit board from a wifi enabled model. I can take a picture of my indoor unit circuit board if you’d like.

It would be great! I tried to find any similar boards in my country and on aliexpress with wifi led or usb wire, but without any success. Wrote to midea directly but they didn’t reply at all. It only remains hope for the official service center, with which I correspond, I will try to purchase and replace boards through them.

I’m a refrigeration technician myself, I can order parts through my employer. I might be able to help out if the official service center isnt helpful.

I’ll take some pictures later today!

1 Like

As promised, here are some pictures of the indoor unit

Make/model of the indoor unit is Inventor AR2MVI-12WiFi, installed 07-2020

Indoor Unit without front panel, I think more manufacturers use this “chassis” and only the front panel covering the filters differs. Maybe someone can confirm this.

PCB overview:

PCB, some numbers/information


I hope this helps, if you have any questions or need a closer picture or something like that dont hestitate to ask. If you search AliExpress for EU-KFR266 you’ll get some hits, so you might succeed there. Pay attention to the components on the PCB, there are different versions on AliExpress.

Found some display units here:

Thanks for your participation! I wrote to this supplier on aliexpress, but they have only boards on the picture that same as mine (4 on the photo). Yes, based on your photos, the only visual difference is in the top bar. From the inside, my air conditioner looks just like yours, one to one. In the evening I will reach the internal board, examine it and compare it with yours. Thank you! I will try to negotiate with the service center and if it doesn’t work out, I’ll ask you for hel

Update from me, I compiled the mideahvac binary using ESPHome, just to be sure I edited the config to add the midea-climate-support repo. After uploading the binary I noticed that the log gets flooded with TX Queries. The blue light on my ESP-01 is constantly blinking. However:

I am able to control my AC Unit from Home Assistant, switching modes, setting the setpoint all works.

Two problems:
The indoor unit is beeping constantly, the frequency of the beep matches the frequency of the blinking ESP-01 LED. Its similar to the problem @yodi has, however I am still able to control the AC while its beeping constantly, but I am not able to turn the unit off! Not from Home Assistant nor with the IR Remote. When I disconnect the ESP from the indoor unit the IR remote is able to turn the unit off.

The logfile when controlling the unit looks like this:

[01:58:17][D][midea_ac:050]: TX: control
[01:58:17][D][midea_dongle:094]: TX: AA 22 AC 00 00 00 00 00 03 02 40 01 63 00 7F 7F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D4 B7 
[01:58:18][W][midea_dongle:030]: RX: frame check failed!
[01:58:18][D][climate:010]: 'Werkkamer' - Setting
[01:58:18][D][climate:014]:   Mode: HEAT
[01:58:18][D][midea_ac:050]: TX: control
[01:58:18][D][midea_dongle:094]: TX: AA 22 AC 00 00 00 00 00 03 02 40 01 83 00 7F 7F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 B9 B2 
[01:58:19][W][midea_dongle:030]: RX: frame check failed!
[01:58:19][D][midea_ac:050]: TX: control
[01:58:19][D][midea_dongle:094]: TX: AA 22 AC 00 00 00 00 00 03 02 40 01 83 00 7F 7F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 B9 B2 
[01:58:20][W][midea_dongle:030]: RX: frame check failed!
[01:58:20][D][midea_ac:050]: TX: control
[01:58:20][D][midea_dongle:094]: TX: AA 22 AC 00 00 00 00 00 03 02 40 01 83 00 7F 7F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 B9 B2 

The logfile when doing nothing looks like this, both with unit turned off and unit running. When the unit is turned off it does not beep constantly, however the LED on the ESP is blinking.

[01:48:39][D][midea_ac:053]: TX: query
[01:48:39][D][midea_dongle:094]: TX: AA 22 AC 00 00 00 00 00 03 03 41 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 84 68 
[01:48:40][D][midea_ac:053]: TX: query
[01:48:40][D][midea_dongle:094]: TX: AA 22 AC 00 00 00 00 00 03 03 41 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 84 68 
[01:48:41][D][midea_ac:053]: TX: query
[01:48:41][D][midea_dongle:094]: TX: AA 22 AC 00 00 00 00 00 03 03 41 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 84 68 
[01:48:42][D][midea_ac:053]: TX: query
[01:48:42][D][midea_dongle:094]: TX: AA 22 AC 00 00 00 00 00 03 03 41 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 84 68 
[01:48:43][D][midea_ac:053]: TX: query
[01:48:43][D][midea_dongle:094]: TX: AA 22 AC 00 00 00 00 00 03 03 41 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 84 68 
[01:48:44][D][midea_ac:053]: TX: query
[01:48:44][D][midea_dongle:094]: TX: AA 22 AC 00 00 00 00 00 03 03 41 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 84 68 
[01:48:45][D][midea_ac:053]: TX: query
[01:48:45][D][midea_dongle:094]: TX: AA 22 AC 00 00 00 00 00 03 03 41 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 84 68 
[01:48:46][D][midea_ac:053]: TX: query
[01:48:46][D][midea_dongle:094]: TX: AA 22 AC 00 00 00 00 00 03 03 41 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 84 68 
[01:48:47][D][midea_ac:053]: TX: query
[01:48:47][D][midea_dongle:094]: TX: AA 22 AC 00 00 00 00 00 03 03 41 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 84 68 
[01:48:48][D][midea_ac:053]: TX: query
[01:48:48][D][midea_dongle:094]: TX: AA 22 AC 00 00 00 00 00 03 03 41 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 84 68 
[01:48:49][D][midea_ac:053]: TX: query
[01:48:49][D][midea_dongle:094]: TX: AA 22 AC 00 00 00 00 00 03 03 41 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 84 68 

and this goes on and on and on…

HA does not receive status updates. I can not see the temperature, it just shows zero degrees. I am not able to see the current mode. The climate card keeps looking like this:

Knipsel

@aceindy Do you have any idea what could cause this behaviour?

Here are some pictures:


@nvschilleman Hmm, i don’t think i can be of real help here, I have been monitoring the development closely, but was never deeply involved, as it was already in an almost finished state (and i am now working on my own pellet stove project)
So the only thing i can suggest is to ask on the original devs on Telegram…

Hi @aceindy,
I’m writing as i finally received all the little stuff needed to control my Giatsu (midea rebrand) splits.

I’ve got the ESP8266 and the ESP01, also the flasher (2x) and did the soldering on one of them to be able to flash.

Now, since the pull request is not implemented in the main git repo yet, I have to find a different way to compile and upload into the ESP.

I see you are mentioning some command lines (if Python is installed), I’ve installed Python for Windows (3.9) and now I am a bit stuck on what to do. I gather I should open the Python 3.9 64bit application and use the commands there, but I’m not sure to understand if a previous download is needed for the ESPflasher or anything else.

So I’m basically ready, with the little board plugged in, python installed and the following code in notepad:

esphome:
  name: giatsu
  platform: ESP8266
  board: esp01_1m

uart:
  tx_pin: 1
  rx_pin: 3
  baud_rate: 9600

midea_dongle:
  midea_dongle_id: Aria Salotto 

midea_ac:
  name: "giatsusalotto" #use and unique name
  beeper: true

wifi:
  ssid: "aabbcc"
  password: "secretpassowrd"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Giatsusalotto Fallback Hotspot"
    password: "secretpassword"

captive_portal:

# Enable logging
logger:
  baud_rate: 0

# Enable Home Assistant API
api:
  password: "secretpassword"

ota:
  password: "secretpassword"

what to do now?
Again, sorry for all the questions :slight_smile:
Thanks!

Create a (temporary?) folder somewhere to store your files (in my case c:\workshop\esphome, but any folder will do).
After that execute the following commands


cd c:\workshop\esphome

pip install esphome
pip install esphomeflasher
pip install --upgrade git+https://github.com/dudanov/esphome.git@midea-climate-support

esphome mideahvac.yaml wizard
esphome mideahvac.yaml compile

esphomeflasher

and in esphomeflasher, use the earlier
compiled bin:

C:_workshop\esphome\mideahvac.pioenvs\mideahvac\firmware.bin

@aceindy Thanks a lot!

It seems I managed to install everything and compile a firmware (I followed the wizard screens, not sure if the right platform was taken by default by doing so, as I’ve been asked to select only the platform (ESP8266) and the board (ESP01_1m), together with the wifi info and OTA password)…

The firmware has been generated and I also flashed it using the modified ESP8266 (I had to install the driver first though, otherwise no COM port was showing up (downloaded from here: https://parzibyte.me/blog/2020/02/09/instalar-driver-esp8266-windows/).
The flash went also fine, it seems :slight_smile:
Now, before connecting the little thing to the AC split, is there a way to check if it’s working as expected?
I have the other ESP8266, not modified, and I should be able to read from it. How could I do it?

Again, thanks a lot for all your help!

UPDATE:
I just checked the connected devices to the router and I can see that the little thing is indeed connected :slight_smile:
Next (last?) step I suppose is to connect the ESP to the AC, I’ve got the voltage converter and some cables to connect directly to the 4pin plug of the AC. Let’s see :slight_smile:

UPDATE2: I checked the AC connection and I have one question and one problem:

  1. The question is how the wiring should work? I have only a 5v print on the board of the AC where the USB cable was plugged, nothing for the rest. How should I connect the wires?
  2. the esp8266 and esp01 together are too bulky to fit the little slot where the usb adapter was. I will have to cut the black support housing the 8266 pins, let’s see what happens…

Sounds interesting, I’m curious to see what you come up with. :slight_smile:

Update2, second question: you can unsolder the pin housing and solder the chips together. :slight_smile: Take a look at Rene Klootwijks manufactured dongle, it is like that. https://github.com/reneklootwijk/mideahvac-dongle

@paddy0174
Yeah, I’ll try to do that, let’s see :slight_smile:

Thanks!