ESP Haier: Haier Air Conditioner + ESP Home + Wemos D1 mini

Hi everybody.

At last, I completed the main part of my ESPHome project for the native Haier ESP32 board. If you want to try it you can find it here: https://github.com/paveldn/ESP32-S0WD-Haier. This changes in the development branch but soon I will put it on master. already on master It is working fine on my AC but of course, I can’t guarantee that it also will work OK for you, so be careful.
If you will try it let me know how it went.

1 Like

Hi paveldn,

I’ve tried to get it working (on Windows), but failed until now.

Already installed Python 3.10.5, pip (py -m ensurepip --upgrade), and esphome (pip install esphome). But that might not be the correct way I guess? :slight_smile:

Maybe I have to copy it to Home Assistant esphome directory?

I also see we cannot use a web_server and captive_portal when using type: esp-idf

Hi KoalaBear,

And what kind of problem/error do you get?
I suppose you should have ESPHome installed already, so should be able to build my code the usual way with the command
esphome compile haier.yaml

I now get:

INFO Reading configuration .\haier.yaml...
ERROR Error while reading config: Invalid YAML syntax:

Error reading file .\secrets.yaml: [Errno 2] No such file or directory: '.\\secrets.yaml'

Which I completely understand, because esphome and all the home assistant parts run on Home Assistant, not on my ‘local’ Windows desktop.

I only know how to get it working when esphome on/inside Home Assistant is building it, not like this, no experience yet with it.

I copied everything to Home Assistant and just added it to esphome and then I do get it working. Will try to see if it works.

Oh, yes you should have secrets.yaml in the same folder with your wifi SSID and password. Like this:

wifi_ssid: "WIFINAME"
wifi_password: "WIFIPASS"

And yes you can’t have web_server and captive_portal because there is no AsyncTCP implementation for esp-idf.

OK, tried it out, looks like no response from the Haier.

[14:06:27][D][Haier:530]: Message sent: FF FF 0A 00 00 00 00 00 00 61 00 07 72
[14:06:32][D][Haier:530]: Message sent: FF FF 0A 00 00 00 00 00 00 61 00 07 72
[14:06:37][D][Haier:530]: Message sent: FF FF 0A 00 00 00 00 00 00 61 00 07 72
[14:06:42][D][Haier:530]: Message sent: FF FF 0A 00 00 00 00 00 00 61 00 07 72
[14:06:47][D][Haier:530]: Message sent: FF FF 0A 00 00 00 00 00 00 61 00 07 72

I’ve tried all 4 possible combinations of RX/TX, both on pin 16/17 and the original RX/TX pins. So I guess I need to really start sniffing the bytes on the Haier Tundra Plus, maybe it’s a completely different scheme.

Yes, that is happening when there is no answer from the device. But what kind of ESP board do you use? On the original board, it should be pins 16/17.
ESP32 by default have 3 UART ports:
UART0 => GPIO 1 and 3
UART1 => GPIO 9 and 10
UART2 => GPIO 17 and 16
But UART1 usually used to work with flash
So you have 2 UARTS:


Of course, if you are using a different ESP32 board probably you will need to use different pins.

P.S. Keep in mind if you want to use UART0 (pins 1 and 3) to work with AC you will need to disable serial logging by adding baud_rate: 0 option to the logging section, like this:

logger:
  level: DEBUG
  baud_rate: 0

I have this board: ESP32-DevKitC V4.

On the first 4 combinations I did use the baud_rate: 0, and for the second 4 combinations I removed it to see if it got different result.

One of the 4 combinations.

The picture looks OK if you trying to communicate through UART0 (Pins 1 and 3) Probably your AC using a different port speed. Mine is working on 9600. You should try to use higher baudrates.

Today i tried on another AC (flexis plus v3), i tried with node mcu v3 as it was easiest locally available thing i could get and same as you, no communications, but i get back message:

[08:28:05][D][Haier:103]: POLL:
0-255
1-255
2-10
3-0
4-0
5-0
6-0
7-0
8-1
9-1
10-77
11-1
12-90

maybe i got confused and this ac is the one that uses “flexisPlusV4” “protocol” (hOn instead of smartair2)

The poll is the data that mcu send to AC, if AC don’t respond… Or the connections aren’t correct or the protocol is different

I redid all the connections (turns out “dupont” cables are not that great)

this is what i get with albetaCOM Haierv2:

[09:23:09][D][Haier:373]: POLL:  255 255 10 64 0 0 0 0 0 1 77 1 153 179 180
[09:23:09][D][Haier:398]: Readed message ALBA:  255 255 42 64 0 0 0 0 0 2 109 1 6 2 69 0 2 0 0 5 0 0 50 0 86 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 182 76 190

with yours i don’t get any response for poll, but again all ACs I’m trying this on are sold as flexis plus here :slight_smile:

I also sometimes suspect the Dupont things to be in the way as they are not solid.

you can take out connector from the plastic housting, mangle it with pliers, cover with tape and that way there is better connection.

For the actual use I will switch to esp01 with shield with serial connector for it and the 4pin wire, that way it will hopefully fit nicer both into the unit and connectors into the pins.

Update: i did one more unit, just removed plastic on dupont and basically crimped and taped the wires onto the board, that is only unit of the three where the connection still works after tidying up the wires. My guess is dupont wires are not that great for “production” usage.

Is there an option to add “light” toggle, so i can turn off AC display from HA (or other ways?). If there as a way I can find out the position that sets it and it’s values.

maybe the light switch could be implemented as light bulb in HA?





Just to make it easier.

Dec Bin Description
48 00110000 Health, Down, Light off
40 00101000 Health, Up, Light off
16 00010000 Health, Down, Light on
32 00100000 Health(?), Up(?), Light off

The third bit seems the light, the fourth looks like the position (Up/Down), but what about the fifth…

Airflow and health mode are two separate things

this is setting for “health”

no idea what it actually does, it is described as “negative ion generator”.

Please tell me why I only work this one from all the firmware? In general, it works, but it does not have a health mode, sleep mode and turn off the display … Who can explain why other firmware does not suit me, the protocol is different or what?

Firmware that worked for me https://github.com/Oksion/esphaier

There are (at least) 2 protocols, as far as I understand. “hOn” or “smartair2”, I think the one you mention is also the one I should try because it says on the original repo that it is a like a replacement of KZW-W001 and KZW-W002 which uses “smartair2” (app).

1 Like

Did you answer me?

Yes, I’ve tried to :slight_smile:

It looks like I didn’t use the “Reply” button, hmm, but it didn’t show it this time also. Strange, it should because I did use the Reply button now.