Hello everyone,
I have 2 Riello air conditioner unit, looking online I found that this Ac unit are in fact a rebranded Midea AC.
This AC Unit can be connected to a proprietary cloud via a WIFI USB key (ref: sk-103 or k02 wifi usb) sell online for 50€ each.
And I didn’t want to spend 100€ just to attach and esp8266 at my AC unit and link to my openhab instance.
So I looked around on github, and I found this repo : GitHub - Links2004/arduinoMideaAC: hack job for decoding and sending Midea AC Serial commands to use my AC with an ESP32 and MQTT.
So here how to do it.
Software Part :
Download the code from GitHub - Links2004/arduinoMideaAC: hack job for decoding and sending Midea AC Serial commands
Put midea.cpp and midea.h under src folder to \Arduino\libraries\midea
open midea.h and modify this line (if you don’t do that, the project will not build on ESP32) :
#ifdef __AVR__
typedef void (*acSerialEvent)(ac_status_t * status);
#else
typedef std::function<void(ac_status_t * status)> acSerialEvent;
#endif
with
typedef std::function<void(ac_status_t * status)> acSerialEvent;
Open arduinoIDE and create a new project.
copy paste this content into your IDE : #2 add MQTT example for Esp32 by Tukks · Pull Request #3 · Links2004/arduinoMideaAC · GitHub
Change SSID, Password, Mqtt server IP, and the topic if you want.
If you have 2 AC Unitm you need to change the Mqtt Client Id, and put something different for each one at this line :
if (client.connect("acsalon", "openhabian", NULL)) {
- Change acsalon for an Id you want,
- openhabian is my username to connect to my mosquito broker, change if different.
- NULL is for the password of mosquitto, put it if you have one
Now connect your ESP32, and upload the project.
Hardware Part :
Here’s what you need :
- an ESP32 https://fr.aliexpress.com/item/32806450471.html
- And logic level converter https://fr.aliexpress.com/item/32482721005.html
- some wire jump : https://fr.aliexpress.com/item/32758932992.html
- a iron solder
- some pin https://fr.aliexpress.com/item/32878876177.html
First you need to unsolder the USB female from the AC Unit. After, that solder 4 pin to the 4 new hole in the AC Unit ex-usb.
Link GPIO1 (Tx) and GPIO3 (RX) from ESP32 to BSCL and BSDA of the logic level converter.
Link the 3v3 pin of the esp32 to BVCC, and GND from esp32 to BGND
Link the AC Unit GND to AGND
Link the AC Unit 5V to AVCC
Link the AC Unit RX to ASCL
Link the AC Unit TX to ASCL
Now everything is connected.
Subscribe to “esp32/acbureau/state” and you will see some data coming.
if you want to control it, send to “esp32/acbureau/command” and send :
{“on”:true,“turbo”:false,“eco”:false,“soll”:23,“lamelle”:false,“mode”:4,“fan”:0}
Possible value :
- on : true/false
- turbo : true/false
- eco : true/false
- soll (temperature): number
- lamelle: true/false
- mode : number, Heat=“4”, Cool=“2”, Auto=“1”, Fan=“5”, Dry=“3”
- fan : number, Min= 1, Medium = 2, High = 3 or Auto = 0
And your AC will power On.
If needed I can provide my items file too.
Hope it help someone, I searched for 3 month on internet and I found nothing until now.
A big thanks to Links2004 on github.
Cheers