albetaCOM / esp-haier

ESP8266 code to connect to Haier Air Conditioner ((firmware version R_1.0.00/e_2.5.14) with wifi module support
52 stars 9 forks source link

Haier Flexis Plus #5

Open DawidPrzybylskiIntel opened 3 years ago

DawidPrzybylskiIntel commented 3 years ago

Hi, all modes Auto/heat/cold are only show in console or in HA but at AC I see probably "dry" mode. Between switches mode I can observe current temperature changed :) How can I help to solve it? image

DawidPrzybylskiIntel commented 3 years ago

Probably read modes works ok, but at AC screen mode does not change when I change it via USB(HA).

DawidPrzybylskiIntel commented 3 years ago

Hi, I switched to Haierv2.h file and tried to find differences in data between case when display show me correct icon and after switch mode by HA when display show me wrong icon.

Proper display, generated by IR pilot: 255 255 42 64 0 0 0 0 0 2 109 1 9 6 37 0 2 1 0 7 0 0 44 0 66 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 135 92 248

Wrong display, generated by switch to HEAT and back to COOL by HA 255 255 42 64 0 0 0 0 0 2 109 1 9 6 37 0 2 3 0 7 0 12 45 0 66 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 152 224 35

DawidPrzybylskiIntel commented 3 years ago

@albetaCOM the problem is set PURIFY_BIT, after each HA operation it set it to ON even if it was OFF before. I look at the code but I don't find any point to fix it. Can you help?

albetaCOM commented 3 years ago

Hi @DawidPrzybylskiIntel, sorry I've not been very active lately. A lot of work and a new baby!

I'll try to have a look and come back to you.

albetaCOM commented 3 years ago

@DawidPrzybylskiIntel in the line 436 of Haierv2.h: SetPurifyControl(GetPurifyStatus()); After polling the status it updates the control_command array to the latest status so whenever a command is sent to the AC unit it should have everything sync.

Maybe the issue is that PURIFY_BIT is not well identified. I mean I was sniffing with Docklight to try to identify the protocol between the wifi and the AC unit, for sure there can be errors in there. Can you uncomment the line 460: ESP_LOGW("Debug", "Purify status = 0x%X", GetPurifyStatus()); and check if it is what it should?

DawidPrzybylskiIntel commented 3 years ago

Yes I use this. When I set mode using IR then Purify is set to 0x0, after set the same mode purify bit is set to 0x1.

snoffy commented 3 years ago

Hi, i have the same problem. Is there any way to permanently disable purify?

albetaCOM commented 3 years ago

Sorry for beeing away so long. Do you still have the problem? I understand that GetPurifyStatus() is getting the correct status, right?

If the status is well read but not the control it must mean that PURIFY_BIT has not the same offset on the status answer and on the control message.

We should look at byte control_command[25] = {0xFF,0xFF,0x14,0x40,0x00,0x00,0x00,0x00,0x00,0x01,0x60,0x01,0x09,0x08,0x25,0x00,0x02,0x03,0x00,0x06,0x00,0x0C,0x03,0x0B,0x70}; and there are probably a value hardcoded that is not updated that is setting the purify on...

Krzysztonek commented 3 years ago

Hi @DawidPrzybylskiIntel I'm also an owner of Haier Flexis Plus, trying to fully integrate/control this device with HA, using ESP8266. Do you, by any chance, have the protocol already decoded? I would try to do it by myself but let's do not reinvent the wheel if it has been already invented! :)

stravinci commented 3 years ago

Hi, DawidPrzybylskiIntel here. I switch to my private profile.

Do you still have the problem? I understand that GetPurifyStatus() is getting the correct status, right? Yes, I still have this problem, but is is not usage blocker :) Thanks for your work.

@Krzysztonek sorry, but I don't have time to decode it.

mjenda commented 2 years ago

Hello, I had similar problem with my Haier Flexis White Matt - regardless of mode set through HA, the unit always switched to Health Mode (azure icon). A sniffed the messages between Haier and original Haier's WiFi dongle and it appeared that in normal modes 22 byte should be set to 0x00 but in control_command[21] is set to 0x0C. Hardcoding it to 0x00 fixes stubborn Health Mode.

And indeed setting Health Mode through remote control sets 22 byte to 0x0C in poll response message:

status_ byte 21: 0x0 --> 0xC
albetaCOM commented 2 years ago

Hello everybody!!

@mjenda thanks for the information. Thanks to that I updated the HaierFlexisPlus.h file to meet the new information.

I am trying with my AC units but I am seeing some problems, I'll come back as soon as I have them solved

stravinci commented 2 years ago

Hi, I check both commits with my Haier Flexis Plus Black:

  1. HaierFlexisPlus.h
    • I cannot do anything using HomeAssistant
    • Current temperature is read as ) 0 degree
  2. Haierv2.h
    • still purify is ON during any HomeAssistant mode changes

One more question: why this integration hasn't OFF mode?

`[13:25:28][I][app:102]: ESPHome version 2021.9.3 compiled on Dec 30 2021, 13:24:04

[13:25:28][C][wifi:362]: IP Address: 192.168.4.13 [13:25:28][C][wifi:364]: BSSID: E6:63:DA:0A:01:8F

[13:25:28][C][wifi:369]: Signal strength: -75 dB ▂▄▆█ [13:25:28][C][wifi:373]: Channel: 6 [13:25:28][C][wifi:374]: Subnet: 255.255.255.0 [13:25:28][C][wifi:375]: Gateway: 192.168.4.1

[13:25:28][C][logger:194]: Level: DEBUG [13:25:28][C][logger:195]: Log Baud Rate: 0 [13:25:28][C][logger:196]: Hardware UART: UART0 [13:25:28][C][restart:021]: Restart Switch 'Restart ac_salon'

[13:25:28][C][web_server:152]: Web Server: [13:25:28][C][web_server:153]: Address: 192.168.4.13:80 [13:25:28][C][ota:029]: Over-The-Air Updates: [13:25:28][C][ota:030]: Address: 192.168.4.13:8266 [13:25:28][C][ota:032]: Using Password. [13:25:29][C][api:135]: API Server: [13:25:29][C][api:136]: Address: 192.168.4.13:6053 [13:25:29][C][api:140]: Using noise encryption: NO [13:25:30][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:25:30][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 0 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 222 185 208 [13:25:30][D][climate:373]: 'AC salon' - Sending state: [13:25:30][D][climate:376]: Mode: OFF [13:25:30][D][climate:393]: Swing Mode: OFF [13:25:30][D][climate:396]: Current Temperature: 18.00°C [13:25:30][D][climate:402]: Target Temperature: 26.00°C [13:25:35][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:25:35][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 0 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 222 185 208 [13:25:35][D][climate:373]: 'AC salon' - Sending state: [13:25:35][D][climate:376]: Mode: OFF [13:25:35][D][climate:393]: Swing Mode: OFF [13:25:35][D][climate:396]: Current Temperature: 18.00°C [13:25:35][D][climate:402]: Target Temperature: 26.00°C [13:25:40][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:25:40][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 0 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 222 185 208 [13:25:40][D][climate:373]: 'AC salon' - Sending state: [13:25:40][D][climate:376]: Mode: OFF [13:25:40][D][climate:393]: Swing Mode: OFF [13:25:40][D][climate:396]: Current Temperature: 18.00°C [13:25:40][D][climate:402]: Target Temperature: 26.00°C [13:25:45][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:25:45][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 0 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 222 185 208 [13:25:45][D][climate:373]: 'AC salon' - Sending state: [13:25:45][D][climate:376]: Mode: OFF [13:25:45][D][climate:393]: Swing Mode: OFF [13:25:45][D][climate:396]: Current Temperature: 18.00°C [13:25:45][D][climate:402]: Target Temperature: 26.00°C [13:25:50][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:25:50][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 0 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 222 185 208 [13:25:50][D][climate:373]: 'AC salon' - Sending state: [13:25:50][D][climate:376]: Mode: OFF [13:25:50][D][climate:393]: Swing Mode: OFF [13:25:50][D][climate:396]: Current Temperature: 18.00°C [13:25:50][D][climate:402]: Target Temperature: 26.00°C [13:25:55][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:25:55][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 0 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 222 185 208 [13:25:55][D][climate:373]: 'AC salon' - Sending state: [13:25:55][D][climate:376]: Mode: OFF [13:25:55][D][climate:393]: Swing Mode: OFF [13:25:55][D][climate:396]: Current Temperature: 18.00°C [13:25:55][D][climate:402]: Target Temperature: 26.00°C [13:25:59][D][climate:009]: 'AC salon' - Setting [13:25:59][D][climate:013]: Mode: HEAT [13:25:59][D][Control:544]: Control call [13:25:59][D][Control:555]: *call.get_mode() = 3 [13:25:59][D][Haier:720]: Message sent: 255 255 20 64 0 0 0 0 0 1 96 1 10 10 133 0 2 3 0 0 0 12 96 29 115 - CRC: 60 - CRC16: 1D73 [13:25:59][D][climate:373]: 'AC salon' - Sending state: [13:25:59][D][climate:376]: Mode: HEAT [13:25:59][D][climate:393]: Swing Mode: OFF [13:25:59][D][climate:396]: Current Temperature: 18.00°C [13:25:59][D][climate:402]: Target Temperature: 26.00°C [13:25:59][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 3 0 0 0 12 37 0 67 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 239 75 37 [13:25:59][D][Debug:325]: Status byte 17: 0x0 --> 0x3 [13:25:59][D][Debug:325]: Status byte 21: 0x0 --> 0xC [13:25:59][D][Debug:325]: Status byte 27: 0x1 --> 0x3 [13:25:59][D][Debug:325]: Status byte 44: 0xDE --> 0xEF [13:25:59][D][Debug:325]: Status byte 45: 0xB9 --> 0x4B [13:25:59][D][Debug:325]: Status byte 46: 0xD0 --> 0x25 [13:25:59][D][climate:373]: 'AC salon' - Sending state: [13:25:59][D][climate:376]: Mode: HEAT [13:25:59][D][climate:381]: Fan Mode: AUTO [13:25:59][D][climate:393]: Swing Mode: OFF [13:25:59][D][climate:396]: Current Temperature: 18.00°C [13:25:59][D][climate:402]: Target Temperature: 26.00°C [13:26:00][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:26:00][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 3 0 0 0 12 37 0 67 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 239 75 37 [13:26:00][D][climate:373]: 'AC salon' - Sending state: [13:26:00][D][climate:376]: Mode: HEAT [13:26:00][D][climate:381]: Fan Mode: AUTO [13:26:00][D][climate:393]: Swing Mode: OFF [13:26:00][D][climate:396]: Current Temperature: 18.00°C [13:26:00][D][climate:402]: Target Temperature: 26.00°C [13:26:05][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:26:05][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 3 0 0 0 12 37 0 67 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 239 75 37 [13:26:05][D][climate:373]: 'AC salon' - Sending state: [13:26:05][D][climate:376]: Mode: HEAT [13:26:05][D][climate:381]: Fan Mode: AUTO [13:26:05][D][climate:393]: Swing Mode: OFF [13:26:05][D][climate:396]: Current Temperature: 18.00°C [13:26:05][D][climate:402]: Target Temperature: 26.00°C [13:26:10][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:26:10][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 3 0 0 0 12 37 0 67 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 239 75 37 [13:26:10][D][climate:373]: 'AC salon' - Sending state: [13:26:10][D][climate:376]: Mode: HEAT [13:26:10][D][climate:381]: Fan Mode: AUTO [13:26:10][D][climate:393]: Swing Mode: OFF [13:26:10][D][climate:396]: Current Temperature: 18.00°C [13:26:10][D][climate:402]: Target Temperature: 26.00°C [13:26:15][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:26:15][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 3 0 0 0 12 37 0 67 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 239 75 37 [13:26:15][D][climate:373]: 'AC salon' - Sending state: [13:26:15][D][climate:376]: Mode: HEAT [13:26:15][D][climate:381]: Fan Mode: AUTO [13:26:15][D][climate:393]: Swing Mode: OFF [13:26:15][D][climate:396]: Current Temperature: 18.00°C [13:26:15][D][climate:402]: Target Temperature: 26.00°C [13:26:20][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:26:20][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 3 0 0 0 12 37 0 67 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 239 75 37 [13:26:20][D][climate:373]: 'AC salon' - Sending state: [13:26:20][D][climate:376]: Mode: HEAT [13:26:20][D][climate:381]: Fan Mode: AUTO [13:26:20][D][climate:393]: Swing Mode: OFF [13:26:20][D][climate:396]: Current Temperature: 18.00°C [13:26:20][D][climate:402]: Target Temperature: 26.00°C [13:26:25][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:26:25][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 3 0 0 0 12 37 0 67 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 239 75 37 [13:26:25][D][climate:373]: 'AC salon' - Sending state: [13:26:25][D][climate:376]: Mode: HEAT [13:26:25][D][climate:381]: Fan Mode: AUTO [13:26:25][D][climate:393]: Swing Mode: OFF [13:26:25][D][climate:396]: Current Temperature: 18.00°C [13:26:25][D][climate:402]: Target Temperature: 26.00°C [13:26:30][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:26:35][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:26:35][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 3 0 0 0 12 37 0 67 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 239 75 37 [13:26:35][D][climate:373]: 'AC salon' - Sending state: [13:26:35][D][climate:376]: Mode: HEAT [13:26:35][D][climate:381]: Fan Mode: AUTO [13:26:35][D][climate:393]: Swing Mode: OFF [13:26:35][D][climate:396]: Current Temperature: 18.00°C [13:26:35][D][climate:402]: Target Temperature: 26.00°C [13:26:40][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:26:40][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 3 0 0 0 12 37 0 67 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 239 75 37 [13:26:40][D][climate:373]: 'AC salon' - Sending state: [13:26:40][D][climate:376]: Mode: HEAT [13:26:40][D][climate:381]: Fan Mode: AUTO [13:26:40][D][climate:393]: Swing Mode: OFF [13:26:40][D][climate:396]: Current Temperature: 18.00°C [13:26:40][D][climate:402]: Target Temperature: 26.00°C [13:26:45][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:26:45][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 3 0 0 0 12 37 0 67 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 239 75 37 [13:26:45][D][climate:373]: 'AC salon' - Sending state: [13:26:45][D][climate:376]: Mode: HEAT [13:26:45][D][climate:381]: Fan Mode: AUTO [13:26:45][D][climate:393]: Swing Mode: OFF [13:26:45][D][climate:396]: Current Temperature: 18.00°C [13:26:45][D][climate:402]: Target Temperature: 26.00°C [13:26:50][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:26:50][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 3 0 0 0 12 37 0 67 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 239 75 37 [13:26:50][D][climate:373]: 'AC salon' - Sending state: [13:26:50][D][climate:376]: Mode: HEAT [13:26:50][D][climate:381]: Fan Mode: AUTO [13:26:50][D][climate:393]: Swing Mode: OFF [13:26:50][D][climate:396]: Current Temperature: 18.00°C [13:26:50][D][climate:402]: Target Temperature: 26.00°C [13:26:55][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:26:55][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 3 0 0 0 12 37 0 67 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 239 75 37 [13:26:55][D][climate:373]: 'AC salon' - Sending state: [13:26:55][D][climate:376]: Mode: HEAT [13:26:55][D][climate:381]: Fan Mode: AUTO [13:26:55][D][climate:393]: Swing Mode: OFF [13:26:55][D][climate:396]: Current Temperature: 18.00°C [13:26:55][D][climate:402]: Target Temperature: 26.00°C [13:27:00][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:27:00][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 3 0 0 0 12 37 0 67 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 239 75 37 [13:27:00][D][climate:373]: 'AC salon' - Sending state: [13:27:00][D][climate:376]: Mode: HEAT [13:27:00][D][climate:381]: Fan Mode: AUTO [13:27:00][D][climate:393]: Swing Mode: OFF [13:27:00][D][climate:396]: Current Temperature: 18.00°C [13:27:00][D][climate:402]: Target Temperature: 26.00°C [13:27:05][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:27:05][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 3 0 0 0 12 37 0 66 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 238 154 24 [13:27:05][D][Debug:325]: Status byte 24: 0x43 --> 0x42 [13:27:05][D][Debug:325]: Status byte 44: 0xEF --> 0xEE [13:27:05][D][Debug:325]: Status byte 45: 0x4B --> 0x9A [13:27:05][D][Debug:325]: Status byte 46: 0x25 --> 0x18 [13:27:05][D][climate:373]: 'AC salon' - Sending state: [13:27:05][D][climate:376]: Mode: HEAT [13:27:05][D][climate:381]: Fan Mode: AUTO [13:27:05][D][climate:393]: Swing Mode: OFF [13:27:05][D][climate:396]: Current Temperature: 18.00°C [13:27:05][D][climate:402]: Target Temperature: 26.00°C [13:27:10][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:27:10][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 10 10 133 0 2 3 0 0 0 12 37 0 67 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 239 75 37 [13:27:10][D][Debug:325]: Status byte 24: 0x42 --> 0x43 [13:27:10][D][Debug:325]: Status byte 44: 0xEE --> 0xEF [13:27:10][D][Debug:325]: Status byte 45: 0x9A --> 0x4B [13:27:10][D][Debug:325]: Status byte 46: 0x18 --> 0x25 [13:27:10][D][climate:373]: 'AC salon' - Sending state: [13:27:10][D][climate:376]: Mode: HEAT [13:27:10][D][climate:381]: Fan Mode: AUTO [13:27:10][D][climate:393]: Swing Mode: OFF [13:27:10][D][climate:396]: Current Temperature: 18.00°C [13:27:10][D][climate:402]: Target Temperature: 26.00°C [13:27:15][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:27:15][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 6 10 133 0 2 1 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 219 107 40 [13:27:15][D][Debug:325]: Status byte 12: 0xA --> 0x6 [13:27:15][D][Debug:325]: Status byte 17: 0x3 --> 0x1 [13:27:15][D][Debug:325]: Status byte 21: 0xC --> 0x0 [13:27:15][D][Debug:325]: Status byte 27: 0x3 --> 0x1 [13:27:15][D][Debug:325]: Status byte 44: 0xEF --> 0xDB [13:27:15][D][Debug:325]: Status byte 45: 0x4B --> 0x6B [13:27:15][D][Debug:325]: Status byte 46: 0x25 --> 0x28 [13:27:15][D][climate:373]: 'AC salon' - Sending state: [13:27:15][D][climate:376]: Mode: HEAT [13:27:15][D][climate:381]: Fan Mode: AUTO [13:27:15][D][climate:393]: Swing Mode: OFF [13:27:15][D][climate:396]: Current Temperature: 18.00°C [13:27:15][D][climate:402]: Target Temperature: 22.00°C [13:27:20][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:27:20][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 5 10 133 0 2 1 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 218 223 40 [13:27:20][D][Debug:325]: Status byte 12: 0x6 --> 0x5 [13:27:20][D][Debug:325]: Status byte 44: 0xDB --> 0xDA [13:27:20][D][Debug:325]: Status byte 45: 0x6B --> 0xDF [13:27:20][D][climate:373]: 'AC salon' - Sending state: [13:27:20][D][climate:376]: Mode: HEAT [13:27:20][D][climate:381]: Fan Mode: AUTO [13:27:20][D][climate:393]: Swing Mode: OFF [13:27:20][D][climate:396]: Current Temperature: 18.00°C [13:27:20][D][climate:402]: Target Temperature: 21.00°C [13:27:25][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:27:25][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 5 10 133 0 2 1 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 218 223 40 [13:27:25][D][climate:373]: 'AC salon' - Sending state: [13:27:25][D][climate:376]: Mode: HEAT [13:27:25][D][climate:381]: Fan Mode: AUTO [13:27:25][D][climate:393]: Swing Mode: OFF [13:27:25][D][climate:396]: Current Temperature: 18.00°C [13:27:25][D][climate:402]: Target Temperature: 21.00°C [13:27:30][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:27:30][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 5 10 133 0 2 1 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 218 223 40 [13:27:30][D][climate:373]: 'AC salon' - Sending state: [13:27:30][D][climate:376]: Mode: HEAT [13:27:30][D][climate:381]: Fan Mode: AUTO [13:27:30][D][climate:393]: Swing Mode: OFF [13:27:30][D][climate:396]: Current Temperature: 18.00°C [13:27:30][D][climate:402]: Target Temperature: 21.00°C [13:27:35][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:27:35][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 5 10 133 0 2 1 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 218 223 40 [13:27:35][D][climate:373]: 'AC salon' - Sending state: [13:27:35][D][climate:376]: Mode: HEAT [13:27:35][D][climate:381]: Fan Mode: AUTO [13:27:35][D][climate:393]: Swing Mode: OFF [13:27:35][D][climate:396]: Current Temperature: 18.00°C [13:27:35][D][climate:402]: Target Temperature: 21.00°C [13:27:40][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:27:40][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 5 10 133 0 2 1 0 0 0 0 37 0 66 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 217 14 21 [13:27:40][D][Debug:325]: Status byte 24: 0x43 --> 0x42 [13:27:40][D][Debug:325]: Status byte 44: 0xDA --> 0xD9 [13:27:40][D][Debug:325]: Status byte 45: 0xDF --> 0xE [13:27:40][D][Debug:325]: Status byte 46: 0x28 --> 0x15 [13:27:40][D][climate:373]: 'AC salon' - Sending state: [13:27:40][D][climate:376]: Mode: HEAT [13:27:40][D][climate:381]: Fan Mode: AUTO [13:27:40][D][climate:393]: Swing Mode: OFF [13:27:40][D][climate:396]: Current Temperature: 18.00°C [13:27:40][D][climate:402]: Target Temperature: 21.00°C [13:27:45][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:27:45][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 5 10 133 0 2 1 0 0 0 0 37 0 66 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 217 14 21 [13:27:45][D][climate:373]: 'AC salon' - Sending state: [13:27:45][D][climate:376]: Mode: HEAT [13:27:45][D][climate:381]: Fan Mode: AUTO [13:27:45][D][climate:393]: Swing Mode: OFF [13:27:45][D][climate:396]: Current Temperature: 18.00°C [13:27:45][D][climate:402]: Target Temperature: 21.00°C [13:27:50][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:27:50][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 5 10 133 0 2 1 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 218 223 40 [13:27:50][D][Debug:325]: Status byte 24: 0x42 --> 0x43 [13:27:50][D][Debug:325]: Status byte 44: 0xD9 --> 0xDA [13:27:50][D][Debug:325]: Status byte 45: 0xE --> 0xDF [13:27:50][D][Debug:325]: Status byte 46: 0x15 --> 0x28 [13:27:50][D][climate:373]: 'AC salon' - Sending state: [13:27:50][D][climate:376]: Mode: HEAT [13:27:50][D][climate:381]: Fan Mode: AUTO [13:27:50][D][climate:393]: Swing Mode: OFF [13:27:50][D][climate:396]: Current Temperature: 18.00°C [13:27:50][D][climate:402]: Target Temperature: 21.00°C [13:27:55][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:27:55][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 5 10 133 0 2 1 0 0 0 0 37 0 65 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 216 61 81 [13:27:55][D][Debug:325]: Status byte 24: 0x43 --> 0x41 [13:27:55][D][Debug:325]: Status byte 44: 0xDA --> 0xD8 [13:27:55][D][Debug:325]: Status byte 45: 0xDF --> 0x3D [13:27:55][D][Debug:325]: Status byte 46: 0x28 --> 0x51 [13:27:55][D][climate:373]: 'AC salon' - Sending state: [13:27:55][D][climate:376]: Mode: HEAT [13:27:55][D][climate:381]: Fan Mode: AUTO [13:27:55][D][climate:393]: Swing Mode: OFF [13:27:55][D][climate:396]: Current Temperature: 18.00°C [13:27:55][D][climate:402]: Target Temperature: 21.00°C [13:28:00][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:28:00][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 5 10 133 0 2 1 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 218 223 40 [13:28:00][D][Debug:325]: Status byte 24: 0x41 --> 0x43 [13:28:00][D][Debug:325]: Status byte 44: 0xD8 --> 0xDA [13:28:00][D][Debug:325]: Status byte 45: 0x3D --> 0xDF [13:28:00][D][Debug:325]: Status byte 46: 0x51 --> 0x28 [13:28:00][D][climate:373]: 'AC salon' - Sending state: [13:28:00][D][climate:376]: Mode: HEAT [13:28:00][D][climate:381]: Fan Mode: AUTO [13:28:00][D][climate:393]: Swing Mode: OFF [13:28:00][D][climate:396]: Current Temperature: 18.00°C [13:28:00][D][climate:402]: Target Temperature: 21.00°C [13:28:05][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:28:05][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 5 10 133 0 2 1 0 0 0 0 37 0 66 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 217 14 21 [13:28:05][D][Debug:325]: Status byte 24: 0x43 --> 0x42 [13:28:05][D][Debug:325]: Status byte 44: 0xDA --> 0xD9 [13:28:05][D][Debug:325]: Status byte 45: 0xDF --> 0xE [13:28:05][D][Debug:325]: Status byte 46: 0x28 --> 0x15 [13:28:05][D][climate:373]: 'AC salon' - Sending state: [13:28:05][D][climate:376]: Mode: HEAT [13:28:05][D][climate:381]: Fan Mode: AUTO [13:28:05][D][climate:393]: Swing Mode: OFF [13:28:05][D][climate:396]: Current Temperature: 18.00°C [13:28:05][D][climate:402]: Target Temperature: 21.00°C [13:28:10][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:28:10][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 5 10 133 0 2 1 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 218 223 40 [13:28:10][D][Debug:325]: Status byte 24: 0x42 --> 0x43 [13:28:10][D][Debug:325]: Status byte 44: 0xD9 --> 0xDA [13:28:10][D][Debug:325]: Status byte 45: 0xE --> 0xDF [13:28:10][D][Debug:325]: Status byte 46: 0x15 --> 0x28 [13:28:10][D][climate:373]: 'AC salon' - Sending state: [13:28:10][D][climate:376]: Mode: HEAT [13:28:10][D][climate:381]: Fan Mode: AUTO [13:28:10][D][climate:393]: Swing Mode: OFF [13:28:10][D][climate:396]: Current Temperature: 18.00°C [13:28:10][D][climate:402]: Target Temperature: 21.00°C [13:28:15][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:28:15][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 5 10 133 0 2 1 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 218 223 40 [13:28:15][D][climate:373]: 'AC salon' - Sending state: [13:28:15][D][climate:376]: Mode: HEAT [13:28:15][D][climate:381]: Fan Mode: AUTO [13:28:15][D][climate:393]: Swing Mode: OFF [13:28:15][D][climate:396]: Current Temperature: 18.00°C [13:28:15][D][climate:402]: Target Temperature: 21.00°C [13:28:20][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:28:20][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 5 10 133 0 2 1 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 218 223 40 [13:28:20][D][climate:373]: 'AC salon' - Sending state: [13:28:20][D][climate:376]: Mode: HEAT [13:28:20][D][climate:381]: Fan Mode: AUTO [13:28:20][D][climate:393]: Swing Mode: OFF [13:28:20][D][climate:396]: Current Temperature: 18.00°C [13:28:20][D][climate:402]: Target Temperature: 21.00°C [13:28:25][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:28:25][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 5 10 133 0 2 1 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 218 223 40 [13:28:25][D][climate:373]: 'AC salon' - Sending state: [13:28:25][D][climate:376]: Mode: HEAT [13:28:25][D][climate:381]: Fan Mode: AUTO [13:28:25][D][climate:393]: Swing Mode: OFF [13:28:25][D][climate:396]: Current Temperature: 18.00°C [13:28:25][D][climate:402]: Target Temperature: 21.00°C [13:28:30][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:28:30][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 5 10 133 0 2 1 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 218 223 40 [13:28:30][D][climate:373]: 'AC salon' - Sending state: [13:28:30][D][climate:376]: Mode: HEAT [13:28:30][D][climate:381]: Fan Mode: AUTO [13:28:30][D][climate:393]: Swing Mode: OFF [13:28:30][D][climate:396]: Current Temperature: 18.00°C [13:28:30][D][climate:402]: Target Temperature: 21.00°C [13:28:35][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:28:35][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 5 10 133 0 2 1 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 218 223 40 [13:28:35][D][climate:373]: 'AC salon' - Sending state: [13:28:35][D][climate:376]: Mode: HEAT [13:28:35][D][climate:381]: Fan Mode: AUTO [13:28:35][D][climate:393]: Swing Mode: OFF [13:28:35][D][climate:396]: Current Temperature: 18.00°C [13:28:35][D][climate:402]: Target Temperature: 21.00°C [13:28:40][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:28:40][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 5 10 133 0 2 1 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 218 223 40 [13:28:40][D][climate:373]: 'AC salon' - Sending state: [13:28:40][D][climate:376]: Mode: HEAT [13:28:40][D][climate:381]: Fan Mode: AUTO [13:28:40][D][climate:393]: Swing Mode: OFF [13:28:40][D][climate:396]: Current Temperature: 18.00°C [13:28:40][D][climate:402]: Target Temperature: 21.00°C [13:28:45][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:28:45][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 5 10 133 0 2 1 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 218 223 40 [13:28:45][D][climate:373]: 'AC salon' - Sending state: [13:28:45][D][climate:376]: Mode: HEAT [13:28:45][D][climate:381]: Fan Mode: AUTO [13:28:45][D][climate:393]: Swing Mode: OFF [13:28:45][D][climate:396]: Current Temperature: 18.00°C [13:28:45][D][climate:402]: Target Temperature: 21.00°C [13:28:50][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:28:50][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 5 10 133 0 2 1 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 218 223 40 [13:28:50][D][climate:373]: 'AC salon' - Sending state: [13:28:50][D][climate:376]: Mode: HEAT [13:28:50][D][climate:381]: Fan Mode: AUTO [13:28:50][D][climate:393]: Swing Mode: OFF [13:28:50][D][climate:396]: Current Temperature: 18.00°C [13:28:50][D][climate:402]: Target Temperature: 21.00°C [13:28:55][D][Haier:377]: POLL: 255 255 10 64 0 0 0 0 0 1 77 1 153 179 180 [13:28:55][D][Haier:402]: Readed message ALBA: 255 255 42 64 0 0 0 0 0 2 109 1 5 10 133 0 2 1 0 0 0 0 37 0 67 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 218 223 40 [13:28:55][D][climate:373]: 'AC salon' - Sending state: [13:28:55][D][climate:376]: Mode: HEAT [13:28:55][D][climate:381]: Fan Mode: AUTO [13:28:55][D][climate:393]: Swing Mode: OFF [13:28:55][D][climate:396]: Current Temperature: 18.00°C [13:28:55][D][climate:402]: Target Temperature: 21.00°C

`

mjenda commented 2 years ago

Hi, thank you @albetaCOM for your changes. Unfortunately it looks like it does not work on my unit neither. Just setting Health byte to 0x00 in raw command and leaving Purify handling as it was should be enough.

@stravinci can you check Haierv2.h from this branch - mjenda/esp-haier@health_fix? This is a revert of ba70f2059532 with added Health byte fix. I've also restored ability to turn AC on/off. It still may not work on your unit but it is worth a shot.

These are just quick fixes on branch rooted on master branch, I've already run my own fork of esp-haier in order to tune the project to my needs.

stravinci commented 2 years ago

Yes it works!!! Also I see Off mode

I'm not sure but I think that fan modes "Turn off" and "Turn on" doesn't work - it should? I don't need it.

mjenda commented 2 years ago

I am glad it works. Yes, these fan modes are not needed since units support only auto, low, medium and high modes. I've just pushed their removal to the branch I had posted above. You can try it if you want.

albetaCOM commented 2 years ago

Hi, I updated the code on commit d5e9bd6. I couldn't try before to solve the issues, sorry It solves also the turn on and off issue

stravinci commented 2 years ago

@albetaCOM yes, now it working good. @mjenda removed unsupported fan modes also works fine

One more question. I have Haier Flexis Plus (currently black, I can test with white), but for me working only haierv2.h, HaierFlexisPlus.h doesn't work (read correct states). Can someone explain me why? :)

albetaCOM commented 2 years ago

I've created the other file because @Krzysztonek told me that he has Haier flexis plus and the bytes that he received on the status are completely different. I thought that like it was a different model than mine the protocol was different in that model so I created HaierFlexisPlus file in order to try with his device. I didn't realize that some flexis plus has the same protocol as mine and work with haierv2 file. Sorry for the misleading information!

El jue., 30 dic. 2021 19:49, stravinci @.***> escribió:

@albetaCOM https://github.com/albetaCOM yes, now it working good. @mjenda https://github.com/mjenda removed unsupported fan modes also works fine

One more question. I have Haier Flexis Plus (currently black, I can test with white), but for me working only haierv2.h, HaierFlexisPlus.h doesn't work (read correct states). Can someone explain me why? :)

— Reply to this email directly, view it on GitHub https://github.com/albetaCOM/esp-haier/issues/5#issuecomment-1003144219, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG5K2QHE3CNIQWKRYIFDFSTUTSSVDANCNFSM4ZLJWXFQ . You are receiving this because you were mentioned.Message ID: @.***>

stravinci commented 2 years ago

Thanks for amazing job!!!

stravinci commented 2 years ago

I'm not C++ programmer, but in my understanding this code: image program get value 0x09 for target_temperature, so you have target temperature set to 25, right? and the value for current_temperature is 0x49, parsed to decimal is 73, then divide by 2, so current temp is read as 36 degree, it is ok? I think that current_temperature is set to NaN (because of divide with rest) or something like that then you get this error. But as I wrote, I'm not C++ programmer.

albetaCOM commented 2 years ago

I'm not C++ programmer, but in my understanding this code: image program get value 0x09 for target_temperature, so you have target temperature set to 25, right? and the value for current_temperature is 0x49, parsed to decimal is 73, then divide by 2, so current temp is read as 36 degree, it is ok? I think that current_temperature is set to NaN (because of divide with rest) or something like that then you get this error. But as I wrote, I'm not C++ programmer.

Hi @stravinci , Yes, you got it right. Current temperature has a 0.5ºC resolution so the value we get from the AC unit is multiplied by 2 that's why we get the value and divide by 2. And the target temperature has an offset.

What do you mean that current temperature is set to NaN (not a number)? Divide with rest won't give you a NaN result. Are you getting NaN error?? Or are you talking about HaierFlexisPlus.h file? That file is very preliminary, I am aware that there are a lot of errors there. I've done it so @Krzysztonek can try to decode the readed status messages from the AC unit, but we have no clue about the control messages to send to the AC unit. (With the Haierv2.h I've sniffed the wifi board to get those control messages)