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

Ahhhh I see! It never crossed my mind to dump the original firmware, I just blindly overwrote it thinking I’d never use it. Any chance you still have that firmware bin file?

This gave me the idea to do some more research, i found a service manual for a model that uses the same indoor PCB as my unit but claims to have the missing sensors. Pins S1 and S2 on CN15 have weak internal pullups to 5V, these should be the pins for the light sensor and human sensor. They dont have the same value pullups, so one is probably a resistive light sensor, the other is a high low signal. Not sure if they need anything to be implemented in firmware on the main pcb to be functional. Havent had a chance to test yet, but we might be able to add generic versions of these sensors to enable these on our units.

Also, i tested echo_status, the bit does indeed silence the beeper, but only for that command, then it automatically returns to 0. so we must send each command with that bit high if we want it to be quiet. This shouldnt be too bad to implement as an option.

Lastly, I noticed there is the option to receive the indoor temperature from the remote vs the builtin temp sensor, based on how the protocol works we might be able to inject that temperature from the esp! allowing us to use other temp sensors from within HA. Byte 13 looks like a prime candidate for where that value should go. But havent been able to test yet.

Please let me know how else i can help, looking forward to potentially all the new features this might bring.

2 Likes

I tested the half_degree bit, same deal as the echo bit, you must send it each command. But it didnt seem to affect the setpoint, i expected everything to need to be doubled. But everything seemed to function as before. Maybe something else needs to be set, for this function to work. Also played around with byte 13 and 16 with no obvious effect.

Im not sure how to implement extra switches in your code, but I think once you have some time to add one, I can try to help out and add all the others as well by following your example

I do have it but there is a unique certificate inside each of bin files so I don’t think mine will work on your board. At least when I accidentally flashed the wrong image to one of my ESP boards (I have 4 of them) it was not able to communicate to the Haier platform. Mast by related to mac address or serial number etc.

Thanks for the service manual nice document to check. But I don’t think it will help us with the protocol. Sadly but there should be much more under the hood. I am afraid the only way to figure out all functionality is to reverse code the original firmware. I have a couple of thoughts but I need some equipment first. I ordered things already but it will take some time to receive.

NIce, that is what I can easily add to functionality. Will try it.

I don’t think remote talks to ESP directly I think it just sends data to AC directly. In the best case, AC reports it to esp. At worst - keep it to itself. But I am just guessing here.

Thanks. I will defiantly ask to help with testing and after I will add a way to update known parameters you can help with adding support to new features.

Yes, I don’t think it would be that easy. And probably not all ACs support this. Or maybe there is just reserved for the future use

That is all in the python code. Yes I probably write short instruction how to do it. But first I need to implement wayt to update parameters properly
.

1 Like

@ivoh95
Added echo option as beeper to configuration. Now you can set beeper: false in yaml file
Updated it on the dev branch.

P.S. And you were right about 20 C to offset it looks better. Also included in sources.

2 Likes

I have tested @paveldn code with 8266 on haier AC with two different protocols

on smartAir2:

[01:45:11][C][uart.arduino_esp8266:102]: UART Bus:
[01:45:11][C][uart.arduino_esp8266:103]:   TX Pin: GPIO1
[01:45:11][C][uart.arduino_esp8266:104]:   RX Pin: GPIO3
[01:45:11][C][uart.arduino_esp8266:106]:   RX Buffer Size: 256
[01:45:11][C][uart.arduino_esp8266:108]:   Baud Rate: 9600 baud
[01:45:11][C][uart.arduino_esp8266:109]:   Data Bits: 8
[01:45:11][C][uart.arduino_esp8266:110]:   Parity: NONE
[01:45:11][C][uart.arduino_esp8266:111]:   Stop bits: 1
[01:45:11][C][uart.arduino_esp8266:113]:   Using hardware serial interface.
[01:45:11][W][uart.arduino_esp8266:127]:   You're using the same serial port for logging and the UART component. Please disable logging over the serial port by setting logger->baud_rate to 0.
[01:45:11][C][captive_portal:088]: Captive Portal:
[01:45:11][C][web_server:125]: Web Server:
[01:45:12][C][web_server:126]:   Address: :80
[01:45:12][C][mdns:084]: mDNS:
[01:45:12][C][mdns:085]:   Hostname: 
[01:45:12][C][ota:085]: Over-The-Air Updates:
[01:45:12][C][ota:086]:   Address: :8266
[01:45:12][C][api:138]: API Server:
[01:45:12][C][api:139]:   Address: :6053
[01:45:12][C][api:143]:   Using noise encryption: NO
[01:45:14][D][Haier:506]: Message sent: FF FF 0A 00 00 00 00 00 00 61 00 07 72
[01:45:15][W][Haier:338]: Incoming packet timeout, packet size 11, expected size 13
[01:45:19][D][Haier:506]: Message sent: FF FF 0A 00 00 00 00 00 00 61 00 07 72
[01:45:20][W][Haier:338]: Incoming packet timeout, packet size 11, expected size 13
[01:45:24][D][Haier:506]: Message sent: FF FF 0A 00 00 00 00 00 00 61 00 07 72
[01:45:25][W][Haier:338]: Incoming packet timeout, packet size 11, expected size 13
[01:45:29][D][Haier:506]: Message sent: FF FF 0A 00 00 00 00 00 00 61 00 07 72
[01:45:30][W][Haier:338]: Incoming packet timeout, packet size 11, expected size 13
[01:45:34][D][Haier:506]: Message sent: FF FF 0A 00 00 00 00 00 00 61 00 07 72
[01:45:35][W][Haier:338]: Incoming packet timeout, packet size 11, expected size 13

8266 on hON model, seems good

[01:53:45][C][logger:275]: Logger:
[01:53:45][C][logger:276]:   Level: DEBUG
[01:53:45][C][logger:277]:   Log Baud Rate: 115200
[01:53:45][C][logger:278]:   Hardware UART: UART0
[01:53:45][C][uart.arduino_esp8266:102]: UART Bus:
[01:53:45][C][uart.arduino_esp8266:103]:   TX Pin: GPIO1
[01:53:45][C][uart.arduino_esp8266:104]:   RX Pin: GPIO3
[01:53:45][C][uart.arduino_esp8266:106]:   RX Buffer Size: 256
[01:53:45][C][uart.arduino_esp8266:108]:   Baud Rate: 9600 baud
[01:53:46][C][uart.arduino_esp8266:109]:   Data Bits: 8
[01:53:46][C][uart.arduino_esp8266:110]:   Parity: NONE
[01:53:46][C][uart.arduino_esp8266:111]:   Stop bits: 1
[01:53:46][C][uart.arduino_esp8266:113]:   Using hardware serial interface.
[01:53:46][W][uart.arduino_esp8266:127]:   You're using the same serial port for logging and the UART component. Please disable logging over the serial port by setting logger->baud_rate to 0.
[01:53:46][C][captive_portal:088]: Captive Portal:
[01:53:46][C][web_server:125]: Web Server:
[01:53:46][C][web_server:126]:   Address: :80
[01:53:46][C][mdns:084]: mDNS:
[01:53:46][C][mdns:085]:   Hostname: 
[01:53:46][C][ota:085]: Over-The-Air Updates:
[01:53:46][C][ota:086]:   Address: :8266
[01:53:46][C][api:138]: API Server:
[01:53:46][C][api:139]:   Address: :6053
[01:53:46][C][api:143]:   Using noise encryption: NO
[01:53:48][D][Haier:506]: Message sent: FF FF 0A 40 00 00 00 00 00 01 4D 01 99 B3 B4
[01:53:48][D][Haier:668]: HVAC Mode = 0x4
[01:53:48][D][Haier:669]: Fan speed Status = 0x5
[01:53:48][D][Haier:670]: Horizontal Swing Status = 0x0
[01:53:48][D][Haier:671]: Vertical Swing Status = 0x2
[01:53:48][D][Haier:672]: Set Point Status = 0x6
[01:53:49][D][climate:385]: '${device_name}' - Sending state:
[01:53:49][D][climate:388]:   Mode: OFF
[01:53:49][D][climate:393]:   Fan Mode: AUTO
[01:53:49][D][climate:399]:   Preset: NONE
[01:53:49][D][climate:405]:   Swing Mode: OFF
[01:53:49][D][climate:408]:   Current Temperature: 25.00°C
[01:53:49][D][climate:414]:   Target Temperature: 22.00°C
[01:53:49][D][Haier:485]: Received Poll command answer message during phase 8, size: 45, content: FF FF 2A 40 00 00 00 00 00 02 6D 01 06 02 45 00 02 02 00 00 00 0C 32 00 5C 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 C6 BB DC
[01:53:51][D][Haier:506]: Message sent: FF FF 08 40 00 00 00 00 00 FC 44 23 40
[01:53:51][D][Haier:485]: Received Signal request answer message during phase 10, size: 17, content: FF FF 0E 40 00 00 00 00 00 FD 00 00 00 00 00 00 4B C1 DD
[01:53:51][D][Haier:285]: WiFi signal is: -41dBm => 67%
[01:53:51][D][Haier:506]: Message sent: FF FF 0C 40 00 00 00 00 00 F7 00 00 00 43 86 F5 F1
[01:53:51][D][Haier:485]: Received Signal level answer message during phase 12, size: 11, content: FF FF 08 40 00 00 00 00 00 05 4D 61 80
[01:53:53][D][Haier:506]: Message sent: FF FF 0A 40 00 00 00 00 00 01 4D 01 99 B3 B4
[01:53:53][D][Haier:668]: HVAC Mode = 0x4
[01:53:53][D][Haier:669]: Fan speed Status = 0x5
[01:53:53][D][Haier:670]: Horizontal Swing Status = 0x0
[01:53:53][D][Haier:671]: Vertical Swing Status = 0x2
[01:53:53][D][Haier:672]: Set Point Status = 0x6
[01:53:54][D][climate:385]: '${device_name}' - Sending state:
[01:53:54][D][climate:388]:   Mode: OFF
[01:53:54][D][climate:393]:   Fan Mode: AUTO
[01:53:54][D][climate:399]:   Preset: NONE
[01:53:54][D][climate:405]:   Swing Mode: OFF
[01:53:54][D][climate:408]:   Current Temperature: 25.00°C
[01:53:54][D][climate:414]:   Target Temperature: 22.00°C
[01:53:54][D][Haier:485]: Received Poll command answer message during phase 8, size: 45, content: FF FF 2A 40 00 00 00 00 00 02 6D 01 06 02 45 00 02 02 00 00 00 0C 32 00 5C 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 C6 BB DC
[01:53:55][D][api:102]: Accepted 192.168.51.3
[01:53:55][D][api.connection:861]: Home Assistant 2022.7.6 (192.168.51.3): Connected successfully
[01:53:58][D][Haier:506]: Message sent: FF FF 0A 40 00 00 00 00 00 01 4D 01 99 B3 B4
[01:53:58][D][Haier:668]: HVAC Mode = 0x4
[01:53:58][D][Haier:669]: Fan speed Status = 0x5
[01:53:58][D][Haier:670]: Horizontal Swing Status = 0x0
[01:53:58][D][Haier:671]: Vertical Swing Status = 0x2
[01:53:58][D][Haier:672]: Set Point Status = 0x6
[01:53:59][D][climate:385]: '${device_name}' - Sending state:
[01:53:59][D][climate:388]:   Mode: OFF
[01:53:59][D][climate:393]:   Fan Mode: AUTO
[01:53:59][D][climate:399]:   Preset: NONE
[01:53:59][D][climate:405]:   Swing Mode: OFF
[01:53:59][D][climate:408]:   Current Temperature: 25.00°C
[01:53:59][D][climate:414]:   Target Temperature: 22.00°C
[01:53:59][D][Haier:485]: Received Poll command answer message during phase 8, size: 45, content: FF FF 2A 40 00 00 00 00 00 02 6D 01 06 02 45 00 02 02 00 00 00 0C 32 00 5C 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 C6 BB DC
[01:54:01][D][Haier:506]: Message sent: FF FF 08 40 00 00 00 00 00 FC 44 23 40
[01:54:01][D][Haier:485]: Received Signal request answer message during phase 10, size: 17, content: FF FF 0E 40 00 00 00 00 00 FD 00 00 00 00 00 00 4B C1 DD
[01:54:01][D][Haier:285]: WiFi signal is: -40dBm => 68%
[01:54:01][D][Haier:506]: Message sent: FF FF 0C 40 00 00 00 00 00 F7 00 00 00 44 87 37 B0
[01:54:01][D][Haier:485]: Received Signal level answer message during phase 12, size: 11, content: FF FF 08 40 00 00 00 00 00 05 4D 61 80
[01:54:03][D][Haier:506]: Message sent: FF FF 0A 40 00 00 00 00 00 01 4D 01 99 B3 B4
[01:54:03][D][Haier:668]: HVAC Mode = 0x4
[01:54:03][D][Haier:669]: Fan speed Status = 0x5
[01:54:03][D][Haier:670]: Horizontal Swing Status = 0x0
[01:54:04][D][Haier:671]: Vertical Swing Status = 0x2
[01:54:04][D][Haier:672]: Set Point Status = 0x6
[01:54:04][D][climate:385]: '${device_name}' - Sending state:
[01:54:04][D][climate:388]:   Mode: OFF
[01:54:04][D][climate:393]:   Fan Mode: AUTO
[01:54:04][D][climate:399]:   Preset: NONE
[01:54:04][D][climate:405]:   Swing Mode: OFF
[01:54:04][D][climate:408]:   Current Temperature: 25.00°C
[01:54:04][D][climate:414]:   Target Temperature: 22.00°C

(yes, i forgot to add substitution section :smiley: )

In HA all looks ok on the first sight and control test, apart from outdoor temperature, seems about 10C off, but after a quick glance at previous posts, guess that was discussed here before.


Maybe just the long time no use thing.

Hi @evlo,

Thanks for testing. Actually, I also have a version for smartAir2 AC. But it is not finished yet. I will publish it on Github soon.

That would be awesome, i have prepared esp32 that terminates with haier fake usb for testing, so then I can try both esp32 and 8266 with smart air.

Were you able to the beep and (mainly) light setting with smartair2 protocol?

Haven’t implemented it yet. Haven’t even tried. I don’t have those ACs just do a test version for @nikolay-mileev and wait until he tests it and gives feedback. for his response. It takes much more time than an implementation for hON models (which I have) so I usually implement features for hON devices and they transfer them to smartAir2 devices. That is why it is move slower.

Hello,

I’ve been trying to flash esphome to my Wemos D1 Mini for a while now, but I’m having some trouble.
My yaml file was validated and I have the Haier.h file in the same place.
These are the logs I get when trying to install:

INFO Reading configuration /config/esphome/haier.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing haier (board: esp01_1m; framework: arduino; platform: platformio/espressif8266 @ 3.2.0)
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- <ESPAsyncTCP-esphome> 1.2.3
|-- <ESPAsyncWebServer-esphome> 2.1.0
|   |-- <ESPAsyncTCP-esphome> 1.2.3
|   |-- <Hash> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|-- <ArduinoJson> 6.18.5
Compiling /data/haier/.pioenvs/haier/src/esphome/components/api/api_connection.cpp.o
Compiling /data/haier/.pioenvs/haier/src/esphome/components/api/api_frame_helper.cpp.o
Compiling /data/haier/.pioenvs/haier/src/esphome/components/api/api_pb2.cpp.o
Compiling /data/haier/.pioenvs/haier/src/esphome/components/api/api_pb2_service.cpp.o

After this home assistant freezes and crashes and I have to power it off and on to get it running again.

Any help would be very much appreciated because really don’t know what else to try. I’ve already tried most of the things on the forum and reinstalled esphome.

Check your Raspberry temperature. Maybe with compilation cpu usage get a high temperature and crash

i don’t know why but it doesnt work with haier lightera
it’s can only turning off my ac, nothing else dont 'work
what is recommended to check?
log:

Summary
INFO Reading configuration /config/esphome/haier-guestroom.yaml...
INFO Starting log output from ac-bedroom2.local using esphome API
INFO Successfully connected to ac-bedroom2.local
[22:25:25][I][app:102]: ESPHome version 2022.6.2 compiled on Aug  5 2022, 22:06:55
[22:25:25][C][wifi:491]: WiFi:
[22:25:25][C][wifi:353]:   Local MAC: A4:E5:7C:B7:D1:06
[22:25:25][C][wifi:354]:   SSID: 'SiMuS2grk'[redacted]
[22:25:25][C][wifi:355]:   IP Address: 192.168.89.184
[22:25:25][C][wifi:356]:   BSSID: DC:2C:6E:25:E0:A6[redacted]
[22:25:25][C][wifi:358]:   Hostname: 'ac-bedroom2'
[22:25:25][C][wifi:360]:   Signal strength: -45 dB ▂▄▆█
[22:25:25][C][wifi:364]:   Channel: 9
[22:25:25][C][wifi:365]:   Subnet: 255.255.255.0
[22:25:25][C][wifi:366]:   Gateway: 192.168.89.1
[22:25:25][C][wifi:367]:   DNS1: 192.168.89.1
[22:25:25][C][wifi:368]:   DNS2: 8.8.8.8
[22:25:25][C][logger:275]: Logger:
[22:25:25][C][logger:276]:   Level: DEBUG
[22:25:25][C][logger:277]:   Log Baud Rate: 0
[22:25:25][C][logger:278]:   Hardware UART: UART0
[22:25:25][C][mdns:084]: mDNS:
[22:25:25][C][mdns:085]:   Hostname: ac-bedroom2
[22:25:25][C][ota:085]: Over-The-Air Updates:
[22:25:25][C][ota:086]:   Address: ac-bedroom2.local:8266
[22:25:25][C][api:138]: API Server:
[22:25:25][C][api:139]:   Address: ac-bedroom2.local:6053
[22:25:25][C][api:143]:   Using noise encryption: NO
[22:25:28][D][Haier:131]: 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 
[22:25:33][D][Haier:131]: 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 
[22:25:38][D][Haier:131]: 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 
[22:25:43][D][Haier:131]: 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 
[22:25:48][D][climate:010]: 'Haier' - Setting
[22:25:48][D][climate:014]:   Mode: OFF
[22:25:48][D][Haier:416]: Sended message: 
0-255
1-255
2-10
3-0
4-0
5-0
6-0
7-0
8-1
9-1
10-77
11-3
12-92 
[22:25:48][D][Haier:416]: Sended message: 
0-0
1-0
2-0
3-0
4-0
5-0
6-0
7-0
8-0
9-1
10-77
11-95
12-0
13-0
14-0
15-0
16-0
17-0
18-0
19-0
20-0
21-0
22-0
23-0
24-0
25-0
26-0
27-0
28-0
29-0
30-0
31-0
32-0
33-0
34-0
35-9
36-0 
[22:25:48][D][climate:010]: 'Haier' - Setting
[22:25:48][D][climate:014]:   Mode: OFF
[22:25:48][D][Haier:416]: Sended message: 
0-255
1-255
2-10
3-0
4-0
5-0
6-0
7-0
8-1
9-1
10-77
11-3
12-92 
[22:25:48][D][Haier:416]: Sended message: 
0-0
1-0
2-0
3-0
4-0
5-0
6-0
7-0
8-0
9-1
10-77
11-95
12-0
13-0
14-0
15-0
16-0
17-0
18-0
19-0
20-0
21-0
22-0
23-0
24-0
25-0
26-0
27-0
28-0
29-0
30-0
31-0
32-0
33-0
34-0
35-9
36-0 
[22:25:48][D][Haier:131]: 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 
[22:25:49][D][climate:010]: 'Haier' - Setting
[22:25:49][D][climate:014]:   Mode: OFF
[22:25:49][D][Haier:416]: Sended message: 
0-255
1-255
2-10
3-0
4-0
5-0
6-0
7-0
8-1
9-1
10-77
11-3
12-92 
[22:25:49][D][Haier:416]: Sended message: 
0-0
1-0
2-0
3-0
4-0
5-0
6-0
7-0
8-0
9-1
10-77
11-95
12-0
13-0
14-0
15-0
16-0
17-0
18-0
19-0
20-0
21-0
22-0
23-0
24-0
25-0
26-0
27-0
28-0
29-0
30-0
31-0
32-0
33-0
34-0
35-9
36-0 
[22:25:49][D][climate:010]: 'Haier' - Setting
[22:25:49][D][climate:014]:   Mode: OFF
[22:25:49][D][Haier:416]: Sended message: 
0-255
1-255
2-10
3-0
4-0
5-0
6-0
7-0
8-1
9-1
10-77
11-3
12-92 
[22:25:49][D][Haier:416]: Sended message: 
0-0
1-0
2-0
3-0
4-0
5-0
6-0
7-0
8-0
9-1
10-77
11-95
12-0
13-0
14-0
15-0
16-0
17-0
18-0
19-0
20-0
21-0
22-0
23-0
24-0
25-0
26-0
27-0
28-0
29-0
30-0
31-0
32-0
33-0
34-0
35-9
36-0 
[22:25:49][D][climate:010]: 'Haier' - Setting
[22:25:49][D][climate:014]:   Mode: OFF
[22:25:49][D][Haier:416]: Sended message: 
0-255
1-255
2-10
3-0
4-0
5-0
6-0
7-0
8-1
9-1
10-77
11-3
12-92 
[22:25:49][D][Haier:416]: Sended message: 
0-0
1-0
2-0
3-0
4-0
5-0
6-0
7-0
8-0
9-1
10-77
11-95
12-0
13-0
14-0
15-0
16-0
17-0
18-0
19-0
20-0
21-0
22-0
23-0
24-0
25-0
26-0
27-0
28-0
29-0
30-0
31-0
32-0
33-0
34-0
35-9
36-0 
[22:25:53][D][Haier:131]: 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 
[22:25:58][D][Haier:131]: 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 

Some models have differents protocols. Try use Albeta code: https://github.com/albetaCOM/esp-haier

@albetaCOM and @paveldn , any know if we can “set the current temperature”?

I have conduct AC, and I want use a external bluetooth temperature sensor as current temperature and Haier use these as temperature instead internal sensor.

Other alternative can be create a “fake wired controller” and send the temperature as wired controller.

Any ideas¿?

I don’t think there is a way to do it through the protocol. I know that Haier ACs support getting temperature from remote control but it goes outside of ESP. I haven’t seen anything in logs or dumps that indicate that protocol supports it. The only way I can think of is to replace room sensor with something controlled by ESP. In the service manual that @ivoh95 provided (ESP Haier: Haier Air Conditioner + ESP Home + Wemos D1 mini - #241 by ivoh95) there is information about room sensor that has a separate connector on the board (page 40 Ambient temp. sensor and page 20) it looks like it is a simple thermistor so potentially you should be able to simulate it.

1 Like

Ive been thinking about a good way to do this, it might not be hard to throw an IR blaster (just an ir led) in the AC unit seeing as how we already have an ESP in it and transmit the room temperature that way. The issue is we would need logs of the IR remote to figure out how that IR protocol works. My AC remote does not support I-Feel, but maybe someone who has one that does can get some kind of IR logs?

Side note, i figured out what the half degree bit does, it adds 1 degree F to the current setpoint. BUT it only works when F mode is enabled. Meaning if there was a F version of the code, thats how we would be able to have 1 degree precision for the setpoint.

A digital potentiometer and the table can be the solution!

Thanks!

Hey everyone,
I’d like to thank you very much for all your hard work. I’m following this project for a long time already and tried it a few times over the last year. But I keep going back to the Homebridge with Android App setup for using Haier inside HA. The main reason for this is that the ESPHome version of Haier lacks the swing left/right option which I use a lot.
But over the last few weeks, Homebridge with Android app setup hasn’t been that stable so once again I’m looking into moving towards this ESPHome setup. But I really want to have the option to activate the left+right swing on my wall AC.

Has anyone been able to implement the left/right swing? Maybe with a seperate switch that toggles the swing?

Hmm, this was a good question I had when I was working on this, the climate entity does not support all the swing modes we have. Not sure what a good way to implement this is, maybe @paveldn has some ideas? Something like a drop down menu?

Although if you’re using my solution, you can quickly “hack” this in by adding some buttons to your yaml. You should modify these buttons to your needs by changing the option after the two |= lines. For a list of available options, look in the hair.h file and you will see a list of definitions of all the possible selections. You can also adjust horizontal and vertical separately.

Hopefully this solves your issue temporarily and hopefully we come up with a better long term solution.

button:
  - platform: template
    name: "Max Left Down Swing"
    on_press:
      - lambda: |-
          id(control_command)[HORIZONTAL_SWING_OFFSET] &= ~HORIZONTAL_SWING_MSK;
          id(control_command)[HORIZONTAL_SWING_OFFSET] |= HORIZONTAL_SWING_MAX_LEFT;
          id(control_command)[VERTICAL_SWING_OFFSET] &= ~VERTICAL_SWING_MSK;
          id(control_command)[VERTICAL_SWING_OFFSET] |= VERTICAL_SWING_DOWN;
          sendData(id(control_command));
  - platform: template
    name: "Max Right Up Swing"
    on_press:
      - lambda: |-
          id(control_command)[HORIZONTAL_SWING_OFFSET] &= ~HORIZONTAL_SWING_MSK;
          id(control_command)[HORIZONTAL_SWING_OFFSET] |= HORIZONTAL_SWING_MAX_RIGHT;
          id(control_command)[VERTICAL_SWING_OFFSET] &= ~VERTICAL_SWING_MSK;
          id(control_command)[VERTICAL_SWING_OFFSET] |= VERTICAL_SWING_UP;
          sendData(id(control_command));

Thank you for your reply @ivoh95!
I tried using your code from Github, but when I use that code in both esphome.yaml and Haier.h the Operation mode stays in auto and no matter what I choose nothing is happening on the AC. If I control the AC via the IR-remote, the changes are not being shown in ESPHome. There is some communication between ESPHome and the AC unit, but it’s not working :frowning:
So I’m not sure what to do to make your code work with my AC. I have the Haier flair unit at home.

[10:14:35][D][Haier:294]: POLLING
[10:14:35][D][Haier:169]: Message sent:  255 255 10 64 0 0 0 0 0 1 77 1 153 179 180  - CRC: 153 - CRC16: B3B4 
[10:14:35][D][Haier:269]: Received Status Message:  255 255 34 64 0 0 0 0 0 2 109 1 0 24 0 48 0 127 0 0 0 0 0 3 0 2 0 0 0 17 0 0 0 0 0 8 
[10:14:35][D][Debug:356]: HVAC Mode = 0x0
[10:14:35][D][Debug:357]: Fan speed Status = 0x0
[10:14:35][D][Debug:358]: Horizontal Swing Status = 0x0
[10:14:35][D][Debug:359]: Vertical Swing Status = 0x8
[10:14:35][D][Debug:360]: Set Point Status = 0x0
[10:14:35][D][climate:385]: 'Airco woonkamer' - Sending state:
[10:14:35][D][climate:388]:   Mode: AUTO
[10:14:35][D][climate:399]:   Preset: ECO
[10:14:35][D][climate:405]:   Swing Mode: OFF
[10:14:35][D][climate:408]:   Current Temperature: 0.00°C
[10:14:35][D][climate:414]:   Target Temperature: 16.00°C

Do any other versions work with the same hardware? To eliminate the possibility of a wiring issue, I know a lot of people have mentioned needing to use level shifters