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 ESP 32S ESP WROOM 32 ESP32 carte de développement 30P/38P Bluetooth et WIFI double cœur CPU avec faible consommation d'énergie MCU ESP 32 | AliExpress
- And logic level converter 5 pièces IIC I2C Module de Conversion de niveau 5V 3V capteur de convertisseur de niveau du système | AliExpress
- some wire jump : Câble Dupont fil de raccordement Dupont 15CM mâle à mâle + femelle à mâle + femelle à femelle cavalier fil de cuivre Dupont câble KIT de bricolage | AliExpress
- a iron solder
- some pin 10 pièces 28pin broches DIP DIP28 IC prises adaptateur Type de soudure prise étroite | AliExpress
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