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

I think I fixed it. Please, check the latest dev commits. One remark I couldn’t make it work with pins 1 and 3 on my device but it worked with pins 13 and 15. Probably it is a defect in my Wemos D1 hardware but who knows just keep this in mind.

This topic name is “Haier Air Conditioner + ESP Home + Wemos D1 mini” and I feel uncomfortable if it is not working on Wemos D1 mini :rofl:
Also, usually problem with one platform indicates that the quality of the code is questionable. I think I will need to rewrite the packet interpretation part in the future.

It works! Also pin 1 and 3 works fine with my ESP. Great Job!
1 remark. The display switch seems to be inverted.

Thanks! And thanks for testing.

It behaves a little bit strangely. Still need to do some experiments to figure out correct behaviour

1 Like

Hi everybody,

In the latest dev version, I changed how external temperature is processed. According to that document, it should be value - 64 (not value / 2 - 20 as it was before). So I changed the way how external sensor offset works now it is valued from -30 to 30 with default 0 (previously default was -20) so if you have any offset for outdoor_temperature in your YAML file please correct it. In the opposite case your temperature will be wrong.

@paveldn did you have time to check the CRC thing I’m having trouble with? I’m thinking it might not be AC deciding not to USE CRC? I think it is probably not my soldering as I replaced board in that unit for ESP32s3 (as it is also BT proxy for BT5)

BTW I’m currently trying to figure out if it is possible to make smartAir2 ac use newer protocol.

I still can’t get how you got it. And it is not possible for me to do anything because there is no original packet in the logs (my bad :frowning: ). Can you reproduce this issue again? You can use the last dev version with the log level set to VERBOSE Then you will see all incoming packets in logs (not only correct packets as before).
Also in the latest dev, I implemented the protocol in a way that it should automatically pick up if AC supports CRC and use it or not based on this. But it works only during the initialization stage. But if AC will “change his mind” and will stop using CRC “on the go” ESP will continue to use CRC in requests but answers will be parsed correctly (CRC checks will be dropped). Of course, it is all theoretical, I never had an opportunity to test it with AC.

Theoretically, it should work but just transport level (packet parsing and lower) commands and internal packet format are different. Also, I have no idea how properly do a “handshake” with smartAir2 AC. I just start asking status. Have no idea if there are commands like on hOn to get the protocol version etc.

1 Like

Sorry one more change: I removed the offset for the outdoor sensor in the new commit. Just opened for myself filters Sensor Component — ESPHome so if you need offset you can use something like this:

climate:
  - platform: haier
    id: ${device_id}
    name: ${device_name} 
    uart_id: ${uart_id}
    outdoor_temperature:
      name: ${device_name} outdoor temperature
      filters:
        - offset: -5

Worst case I will just do restart on CRC error :slight_smile:

I tried to capture smartAir2 LOG on pin 6 and 7 mentioned here Microsoft OneDrive - Access files anywhere. Create docs with free Office Online. and this


is what i got

using 38400

image

=========================================================

ROM Version: 0.3

Build ToolChain Version: gcc version 4.8.3 (Realtek ASDK-4.8.3p1 Build 2003)

=========================================================
Check boot type form eFuse
SPI Initial
Image1 length: 0x4a88, Image Addr: 0x10000bc8
Image1 Validate OK, Going jump to Image1
===== Enter Image 1 ====

load OLD fw 1
Flash Image2:Addr 0x85000, Len 299252, Load to SRAM 0x10006000
No Image3
Img2 Sign: RTKWin, InfaStart @ 0x10006079
===== Enter Image 2 ====

=========================================================
Haier Build Time: 2017/06/14- 9:50:38
Haier Build Author: haier_fenggq
Haier Build Host: haier_fenggq-PC
Haier Build ToolChain Version: IAR compiler
Haier Build Lib Version: v3.4c
=========================================================
#
Initializing WIFI ...
Start LOG SERVICE MODE

#
WIFI initialized

init_thread(58), Available heap 0xdd60
=========================================================
Hardware version:R_1.0.00
Software version:e_2.3.12
PLATFORM:UHOME_OVERSEAS_AC
=========================================================

ioctl[SIOCGIWESSID] ssid = NULL, not connected
RTL4268195]: dA[HAev_dL]: elaISR y, 681 h3: Dad bevieen ce sallotatecate idd!!!
0x00RTL8
195RTL8A[HA195AL]: [HALISR]: I 81 SR 5had  habeend be allen aocatlloed!!cate!
d!!!
 Period = 0x00007530
WdgScalar = 0x000007a4
WdgCunLimit = 0x00000008
[5043]: dev_resume, 90: Device state id 0x01
[5123]: [uart]tx1[cmd 0x61 len=13]
[5231]: [uart]rx [cmd 0x03 len=13]
[5264]: dev_handshake_handle_rsp, 933: Device state id 0x03
[5340]: [uart]tx1[cmd 0x70 len=11]
[5446]: [uart]rx [cmd 0x03 len=13]
[5489]: TypeID:00000000000000008080000000041410, EppVer:1.00, platform:UHOME_OVE                                                                                                                              RSEAS_AC, TYPE:2
[5514]: dev_handshake_handle_rsp, 983: Device state id 0x04
[5555]: [uart]tx1[cmd 0x01 len=13]
[5692]: [uart]rx [cmd 0x02 len=37]
[5778]: wifi_init,ENTER_WORK_MODE!

WIFI is already running[5793][[579Dwif6]: i_hawifndlei_ha_quendleue h_quandleue                                                                                                                               e suhandmcmdle  [UAsumcR
md [UART_OK][3]
[6065]: connect to AP ssid[] key[] uplus-haier-ac-c935-v0
[6082][I]: Connect to [] with password [], channel [3] and encrypt [6]


Excute fast connect!
RTL8195A[Driver]: set ssid []

RTL8195A[Driver]: start auth to 

RTL8195A[Driver]: auth success, start assoc

RTL8195A[Driver]: association success(res=26)

RTL8195A[Driver]: set pairwise key to hw: alg:4()

RTL8195A[Driver]: set group key to hw: alg:4() keyid:1
[7447][I]: Wifi connect successed after 1365ms!


IP address : 192.168.50.43[7967]: wifi_ip: 192.168.50.43
[7975]: wifi_mac 2C37C510C935
[7984][I]: DHCP succeed after 1902ms!

[7995]: AP Connect Check End
[8006]: wifi_handle_queue handle sumcmd [AP_CONNECTED][6]
[8047]: [uart]tx1[cmd 0xf7 len=15]
[8081]: Server Connect Check, 3min begin.
[8155]: [uart]rx [cmd 0x05 len=11]
[8212]: connect svr fd[3] to server 52.233.190.94:56808, host strlen 13
[8231]: mine 192.168.50.43:49153
[8240][I]: HaierUhome: peer_cn 52.233.190.94
[8394][I]: HaierUhome: SSL ciphersuite: TLS-RSA-WITH-AES-256-CBC-SHA256
[8413][I]: socketfd=3 info->ssl=0x10066110
[8479][I]: socketfd=3 info->ssl=0x10066110
[8500][I]: socketfd=3 info->ssl=0x10066110
[8582]: Server Connect Check End.
[8600]: wifi_handle_queue handle sumcmd [MASTER_SUCCEEDED][9]
[8676]: Server Connect Check, 3min begin.
[10764]: [uart]tx1[cmd 0x01 len=13]
[10901]: [uart]rx [cmd 0x02 len=37]
[11460]: connect svr fd[3] to server 52.233.190.94:56661, host strlen 13
[11479]: mine 192.168.50.43:49154
[11488][I]: HaierUhome: peer_cn 52.233.190.94
[11554][I]: Verify requested for (Depth 1):

[11566][I]: cert. version     : 3
serial number     : B0:33:7F:64:BA:F0:BB:94
issuer name       : O=haier ubic, L=BeiJing, ST=BeiJing, C=CN, CN=gw.haier.net
subject name      : O=haier ubic, L=BeiJing, ST=BeiJing, C=CN, CN=gw.haier.net
issued  on        : 2014-10-30 05:22:49
expires on        : 2044-10-22 05:22:49
signed using      : RSA with MD5
RSA key size      : 1024 bits
basic constraints : CA=true

[11675][I]:   This certificate has no flags

[11687][I]: Verify requested for (Depth 0):

[11700][I]: cert. version     : 1
serial number     : 03
issuer name       : O=haier ubic, L=BeiJing, ST=BeiJing, C=CN, CN=gw.haier.net
subject name      : C=CN, ST=BeiJing, O=haier ubic, OU=npt, CN=gw.haier.net
issued  on        : 2014-10-30 05:39:08
expires on        : 2044-10-22 05:39:08
signed using      : RSA with MD5
RSA key size      : 1024 bits

[11796][I]:   This certificate has no flags

[11911][I]: HaierUhome: SSL ciphersuite: TLS-RSA-WITH-AES-256-CBC-SHA256
[11976]: Server Connect Check End.
[11994]: wifi_handle_queue handle sumcmd [SERVER_CONNECTED][10][12
010]: [uart]tx1[cmd 0xf7 len=15]
[12049][I]: socketfd=3 info->ssl=0x10066010
[12071][I]: socketfd=3 info->ssl=0x10066010
[12092][I]: socketfd=3 info->ssl=0x10066010
[12113]: uwt rx cmd[10006],con_index[8],[12fd[3123]]
: [uart]rx [cmd 0x05 len=11]
[12136]: wifi_handle_queue handle sumcmd [VER_RPT_ACK][11]
[12151]: recv ver rpt ack , send keep alive to svr.
[12385][I]: socketfd=3 info->ssl=0x10066010
[12406][I]: socketfd=3 info->ssl=0x10066010
[12427]: uwt rx cmd[10016],con_index[8],fd[3]
[13167][I]: socketfd=3 info->ssl=0x10066010
[13188][I]: socketfd=3 info->ssl=0x10066010
[13209][I]: socketfd=3 info->ssl=0x10066010
[13230]: uwt rx cmd[10004],con_index[8],fd[3]
[16035]: [uart]tx1[cmd 0x01 len=13]
[16172]: [uart]rx [cmd 0x02 len=37]
[21231]: [uart]tx1[cmd 0x01 len=13]======================
[21367]: [uart]rx [cmd 0x02 len=37]
[21976]: [uart]tx1[cmd 0xf7 len=15]
[22085]: [uart]rx [cmd 0x05 len=11]
[26444]: [uart]tx1[cmd 0x01 len=13]
[26580]: [uart]rx [cmd 0x02 len=37]
[31639]: [uart]tx1[cmd 0x01 len=13]======================4.8.3p1 Build 2003)
[31775]: [uart]rx [cmd 0x02 len=37]
[32034]: [uart]tx1[cmd 0xf7 len=15]n 4.8.3 (Realtek ASDK-4.8.3p1 Build 2003)
[32144]J@NKJBDH
[36856]: [uart]tx1[cmd 0x01 len=13] 681 h3: Dad bevieen ce sallotatecate idd!!! type form eFuse
[36992]: [uart]rx [cmd 0x02 len=37]
[42051]: [uart]tx1[cmd 0xf7 len=15]
[42160]: [uart]rx [cmd 0x05 len=11]
[42269]: [uart]tx1[cmd 0x01 len=13]
[42404]: [uart]rx [cmd 0x02 len=37]
[47463]: [uart]tx1[cmd 0x01 len=13]
[47600]: [uart]rx [cmd 0x02 len=37]
[52059]: [uart]tx1[cmd 0xf7 len=15]
[52169]: [uart]rx [cmd 0x05 len=11]
[52678]: [uart]tx1[cmd 0x01 len=13]
[52815]: [uart]rx [cmd 0x02 len=37]
[57874]: [uart]tx1[cmd 0x01 len=13]
[58010]: [uart]rx [cmd 0x02 len=37]
[62119]: [uart]tx1[cmd 0xf7 len=15]
[62227]: [uart]rx [cmd 0x05 len=11]
[63136]: [uart]tx1[cmd 0x01 len=13]
[63272]: [uart]rx [cmd 0x02 len=37]
[67212]: period send keep alive to svr.
[67246][I]: socketfd=3 info->ssl=0x10066010
[67268][I]: socketfd=3 info->ssl=0x10066010
[67289]: uwt rx cmd[10016],con_index[8],fd[3]
[68331]: [uart]tx1[cmd 0x01 len=13]
[68468]: [uart]rx [cmd 0x02 len=37]
[72127]: [uart]tx1[cmd 0xf7 len=15]
[72235]: [uart]rx [cmd 0x05 len=11]
[73544]: [uart]tx1[cmd 0x01 len=13]
[73681]: [uart]rx [cmd 0x02 len=37]
[78740]: [uart]tx1[cmd 0x01 len=13]
[78876]: [uart]rx [cmd 0x02 len=37]
[82185]: [uart]tx1[cmd 0xf7 len=15]
[82294]: [uart]rx [cmd 0x05 len=11]
[83953]: [uart]tx1[cmd 0x01 len=13]
[84089]: [uart]rx [cmd 0x02 len=37]
[89198]: [uart]tx1[cmd 0x01 len=13]
[89335]: [uart]rx [cmd 0x02 len=37]
[92194]: [uart]tx1[cmd 0xf7 len=15]
[92302]: [uart]rx [cmd 0x05 len=11]
[94411]: [uart]tx1[cmd 0x01 len=13]
[94547]: [uart]rx [cmd 0x02 len=37]
[99606]: [uart]tx1[cmd 0x01 len=13]
[99742]: [uart]rx [cmd 0x02 len=37]
[102201]: [uart]tx1[cmd 0xf7 len=15]
[102311]: [uart]rx [cmd 0x05 len=11]
[104820]: [uart]tx1[cmd 0x01 len=13]
[104956]: [uart]rx [cmd 0x02 len=37]
[110065]: [uart]tx1[cmd 0x01 len=13]
[110201]: [uart]rx [cmd 0x02 len=37]
[112260]: [uart]tx1[cmd 0xf7 len=15]
[112369]: [uart]rx [cmd 0x05 len=11]
[115278]: [uart]tx1[cmd 0x01 len=13]
[115414]: [uart]rx [cmd 0x02 len=37]
[120473]: [uart]tx1[cmd 0x01 len=13]
[120609]: [uart]rx [cmd 0x02 len=37]
[122252]: period send keep alive to svr.
[122268]: [uart]tx1[cmd 0xf7 len=15]
[122290][I]: socketfd=3 info->ssl=0x10066010
[122311][I]: socketfd=3 info->ssl=0x10066010
[122332]: uwt rx cmd[10016],con_index[8],fd[3]
[122378]: [uart]rx [cmd 0x05 len=11]
[125687]: [uart]tx1[cmd 0x01 len=13]
[125824]: [uart]rx [cmd 0x02 len=37]
[130883]: [uart]tx1[cmd 0x01 len=13]

I will need to do the reset again as I got some weird data

I 81 SR 5had  habeend be allen aocatlloed!!cate!
d!!!
681 h3: Dad bevieen ce sallotatecate idd!!!

hmmm pretty much same

=========================================================

ROM Version: 0.3

Build ToolChain Version: gcc version 4.8.3 (Realtek ASDK-4.8.3p1 Build 2003)

=========================================================
Check boot type form eFuse
SPI Initial
Image1 length: 0x4a88, Image Addr: 0x10000bc8
Image1 Validate OK, Going jump to Image1
===== Enter Image 1 ====

load OLD fw 1
Flash Image2:Addr 0x85000, Len 299252, Load to SRAM 0x10006000
No Image3
Img2 Sign: RTKWin, InfaStart @ 0x10006079
===== Enter Image 2 ====

=========================================================
Haier Build Time: 2017/06/14- 9:50:38
Haier Build Author: haier_fenggq
Haier Build Host: haier_fenggq-PC
Haier Build ToolChain Version: IAR compiler
Haier Build Lib Version: v3.4c
=========================================================
#
Initializing WIFI ...
Start LOG SERVICE MODE

#
WIFI initialized

init_thread(58), Available heap 0xdd60
=========================================================
Hardware version:R_1.0.00
Software version:e_2.3.12
PLATFORM:UHOME_OVERSEAS_AC
=========================================================

ioctl[SIOCGIWESSID] ssid = NULL, not connected
RTL426]819: de5A[Hv_deAL]:lay ISR, 63 81 : Dehad vicbeene st allate ocatid ed!!0x00!

RTL8RTL195A8195[HALA[HA]: IL]:SR 8 ISR1 ha 5 hd bead en abeenlloc allatedoca!!!
ted!!!
 Period = 0x00007530
WdgScalar = 0x000007a4
WdgCunLimit = 0x00000008
[5043]: dev_resume, 90: Device state id 0x01
[5122]: [uart]tx1[cmd 0x61 len=13]
[5231]: [uart]rx [cmd 0x03 len=13]
[5264]: dev_handshake_handle_rsp, 933: Device state id 0x03
[5340]: [uart]tx1[cmd 0x70 len=11]
[5446]: [uart]rx [cmd 0x03 len=13]
[5489]: TypeID:00000000000000008080000000041410, EppVer:1.00, platform:UHOME_OVERSEAS_AC, TYPE:2
[5514]: dev_handshake_handle_rsp, 983: Device state id 0x04
[5555]: [uart]tx1[cmd 0x01 len=13]
[5692]: [uart]rx [cmd 0x02 len=37]
[5778]: wifi_init,ENTER_WORK_MODE!

WIFI is already running[5793][[579Dwif6]: i_hawifndlei_ha_quendleue h_quandleue e suhandmcmdle  [UAsumcR
md [UART_OK][3]
[6065]: connect to AP ssid[] key[] uplus-haier-ac-c935-v0
[6082][I]: Connect to [] with password [], channel [3] and encrypt [6]


Excute fast connect!
RTL8195A[Driver]: set ssid []

RTL8195A[Driver]: start auth to 24:4b:fe:72:07:78

RTL8195A[Driver]: auth success, start assoc

RTL8195A[Driver]: association success(res=36)

RTL8195A[Driver]: set pairwise key to hw: alg:4()

RTL8195A[Driver]: set group key to hw: alg:4() keyid:1
[7440][I]: Wifi connect successed after 1358ms!


IP address : 192.168.50.43[7968]: wifi_ip: 192.168.50.43
[7976]: wifi_mac 2C37C510C935
[7985][I]: DHCP succeed after 1903ms!

[7996]: AP Connect Check End
[8019]: wifi_handle_queue handle sumcmd [AP_CONNECTED][6]
[8041]: [uart]tx1[cmd 0xf7 len=15]
[8071]: connect svr fd[3] to server 52.233.190.94:56808, host strlen 13
[8090]: mine [8091 Co4]: nnecSert Chver eck,Conn 3miectn Ch[810er_c6][In 5]: H2.23aier3.19Uhom0.9e: peer_cn 52.233.190.94
[8151]: [uart]rx [cmd 0x05 len=11]
[8267][I]: HaierUhome: SSL ciphersuite: TLS-RSA-WITH-AES-256-CBC-SHA256
[8286][I]: socketfd=3 info->ssl=0x10066090
[8365][I]: socketfd=3 info->ssl=0x10066090
[8386][I]: socketfd=3 info->ssl=0x10066090
[8465]: Server Connect Check End.
[8483]: wifi_handle_queue handle sumcmd [MASTER_SUCCEEDED][9]
[8559]: Server Connect Check, 3min begin.
[10765]: [uart]tx1[cmd 0x01 len=13]
[10901]: [uart]rx [cmd 0x02 len=37]
[11320]: connect svr fd[3] to server 52.233.190.94:56661, host strlen 13
[11339]: mine 192.168.50.43:49154
[11348][I]: HaierUhome: peer_cn 52.233.190.94
[11413][I]: Verify requested for (Depth 1):

[11425][I]: cert. version     : 3
serial number     : B0:33:7F:64:BA:F0:BB:94
issuer name       : O=haier ubic, L=BeiJing, ST=BeiJing, C=CN, CN=gw.haier.net
subject name      : O=haier ubic, L=BeiJing, ST=BeiJing, C=CN, CN=gw.haier.net
issued  on        : 2014-10-30 05:22:49
expires on        : 2044-10-22 05:22:49
signed using      : RSA with MD5
RSA key size      : 1024 bits
basic constraints : CA=true

[11534][I]:   This certificate has no flags

[11547][I]: Verify requested for (Depth 0):

[11560][I]: cert. version     : 1
serial number     : 03
issuer name       : O=haier ubic, L=BeiJing, ST=BeiJing, C=CN, CN=gw.haier.net
subject name      : C=CN, ST=BeiJing, O=haier ubic, OU=npt, CN=gw.haier.net
issued  on        : 2014-10-30 05:39:08
expires on        : 2044-10-22 05:39:08
signed using      : RSA with MD5
RSA key size      : 1024 bits

[11655][I]:   This certificate has no flags

[11771][I]: HaierUhome: SSL ciphersuite: TLS-RSA-WITH-AES-256-CBC-SHA256
[11799]: wifi_handle_queue handle sumcmd [S[118ERVE10]:R_CO [uaNNErt]tCTEDx1[c][10md 0]
xf7 len=15]
[11875][I]: socketfd=3 info->ssl=0x10002678
[11897][I]: socketfd=3 info->ssl=0x10002678
928]18][I]: socketfd=3 info->ssl=0x10002[11678
: [uart]rx [cmd 0x05 len=11]
[11941]: uwt rx cmd[10006],con_index[8],fd[3]
[11953]: Server Connect Check End.
[11972]: wifi_handle_queue handle sumcmd [VER_RPT_ACK][11]
[11987]: recv ver rpt ack , send keep alive to svr.
[12151][I]: socketfd=3 info->ssl=0x10002678
[12172][I]: socketfd=3 info->ssl=0x10002678
[12193]: uwt rx cmd[10016],con_index[8],fd[3]
[13145][I]: socketfd=3 info->ssl=0x10002678
[13166][I]: socketfd=3 info->ssl=0x10002678
[13187][I]: socketfd=3 info->ssl=0x10002678
[13208]: uwt rx cmd[10004],con_index[8],fd[3]
[16039]: [uart]tx1[cmd 0x01 len=13]
[16175]: [uart]rx [cmd 0x02 len=37]
[21234]: [uart]tx1[cmd 0x01 len=13]
[21371]: [uart]rx [cmd 0x02 len=37]
[21830]: [uart]tx1[cmd 0xf7 len=15]
[21938]: [uart]rx [cmd 0x05 len=11]
[26447]: [uart]tx1[cmd 0x01 len=13]
[26583]: [uart]rx [cmd 0x02 len=37]
[31642]: [uart]tx1[cmd 0x01 len=13]
[31779]: [uart]rx [cmd 0x02 len=37]
[31888]: [uart]tx1[cmd 0xf7 len=15]
[31996]: [uart]rx [cmd 0x05 len=11]
[36855]: [uart]tx1[cmd 0x01 len=13]
[36992]: [uart]rx [cmd 0x02 len=37]
[41901]: [uart]tx1[cmd 0xf7 len=15]
[42010]: [uart]rx [cmd 0x05 len=11]
[42119]: [uart]tx1[cmd 0x01 len=13]
[42254]: [uart]rx [cmd 0x02 len=37]

not much info in it,

UHOME_OVERSEAS_AC gives zero results when searching for it

[5340]: [uart]tx1[cmd 0x70 len=11]
[5446]: [uart]rx [cmd 0x03 len=13]
[5489]: TypeID:00000000000000008080000000041410, EppVer:1.00, platform:UHOME_OVERSEAS_AC, TYPE:2
[5514]: dev_handshake_handle_rsp, 983: Device state id 0x04

maybe it is possible to send some command to it to log more like actual rx tx commands etc.

8090]: mine [8091 Co4]: nnecSert weird that it is Co … 4]: … nnect
maybe i still have wrong baudrate?

Don’t have access to the onedrive files that you posted but it looks to me like you connected your serial without connecting to the ground properly. If you connect just tx and rx but not gound you can have noise when the transmission goes both directions simultaneously.
The protocol goes It is funny. Looks like frame types are the same as for hOn but some of the messages not supported. The module starts talking exactly like hOn but AC rejects the first two commands:

# Trying to figure out AC module and capabilities
[5122]: [uart]tx1[cmd 0x61 len=13]
# rejected
[5231]: [uart]rx [cmd 0x03 len=13]
# Trying to request AC ID
[5340]: [uart]tx1[cmd 0x70 len=11]
# rejected
[5446]: [uart]rx [cmd 0x03 len=13]
# get status
[5555]: [uart]tx1[cmd 0x01 len=13]
# AC status
[5692]: [uart]rx [cmd 0x02 len=37]
# Report network status (wifi signal level) ?
[8041]: [uart]tx1[cmd 0xf7 len=15]
# Confirmed
[8151]: [uart]rx [cmd 0x05 len=11]
# get status
[10765]: [uart]tx1[cmd 0x01 len=13]
# AC status
[10901]: [uart]rx [cmd 0x02 len=37]
# get status
[16039]: [uart]tx1[cmd 0x01 len=13]
# AC status
[16175]: [uart]rx [cmd 0x02 len=37]
# get status
[21234]: [uart]tx1[cmd 0x01 len=13]
# AC status
[21371]: [uart]rx [cmd 0x02 len=37]
# Report network status (wifi signal level) ?
[21830]: [uart]tx1[cmd 0xf7 len=15]
# Confirmed
[21938]: [uart]rx [cmd 0x05 len=11]
# get status
[26447]: [uart]tx1[cmd 0x01 len=13]
# AC status
[26583]: [uart]rx [cmd 0x02 len=37]
# get status
[31642]: [uart]tx1[cmd 0x01 len=13]
# AC status
[31779]: [uart]rx [cmd 0x02 len=37]
# Report network status (wifi signal level) ?
[31888]: [uart]tx1[cmd 0xf7 len=15]
# Confirmed
[31996]: [uart]rx [cmd 0x05 len=11]
# get status
[36855]: [uart]tx1[cmd 0x01 len=13]
# AC status
[36992]: [uart]rx [cmd 0x02 len=37]
# Report network status (wifi signal level) ?
[41901]: [uart]tx1[cmd 0xf7 len=15]
# Confirmed
[42010]: [uart]rx [cmd 0x05 len=11]
# get status
[42119]: [uart]tx1[cmd 0x01 len=13]
# AC status
[42254]: [uart]rx [cmd 0x02 len=37]

e++ 2.18 PCB

Smart air 2 / UHOME_OVERSEAS_AC PCB

Only difference seems to be timestamp on the photo, boards look same, dip switches same. I even remember that the one that that says 2017 timestamp got exchanged by haier because one that arrived with the AC was broken. So I guess that is the classic Eastern European ojeb.

I’m considering swapping the PCBs between the indoor units as it really looks the same, only difference is “jumper” setting for display.


r5f100lea both

Boards are same, but SW is probably different other than support for newer protocol it seems that L at the end denotes larger units with 2 downward flash, N is for smaller (normal?) units with one flap.

@paveldn it would not be me if you wouldn’t have another one

When going from sleep to off I get Request answer timeout [11:17:48][D][haier.climate:623]: Received Poll command answer message during ph - Pastebin.com (possibly same scenario for the crc issue)

sorry for the bt proxy stuff in the log.

After sending some other command (change target temperature in the example) AC reacts to the OFF command no problem.

It looks to me like there is some error on the AC side. According to protocol AC should always answer. If something is wrong with a command, it should send you an invalid packet (0x03). It is still not really clear to me this master-slave mode and interactive mode. But there is no info on how to switch between these modes. And according to the info that my AC provides, it doesn’t support it. THere is a chance that you AC switched mode to interactive.
Thanks for the info will try to reproduce it.

looked to me that way too :confused:

@evlo ,
I think I found the root cause of the problems you had with AC not answering some messages. Here you can get details: AC turns off after power outage · Issue #3 · paveldn/ESP32-S0WD-Haier · GitHub (starting from this message)
I am working on a fix.

That is great, sadly i’m currently having issue with smartAir2 unit turning itself off randomly (and display is off]. I think it might just be some broken solder etc. of my esp32 board creation.

Default settings restore from esp module is interesting as this does not happen (did not) on smartAir2 revision units - that one did boot int default always, but the hOn ones would restore last settings.

I will need to try whether restore is done from espmodule or even with no module depending on the board revision.

1 Like

Hi everybody,

I know you haven’t heard from me for a while. All this time I was busy with a new implementation of the Haier protocol. Yesterday I pushed it to the “experimental” branch of my repository: https://github.com/paveldn/ESP32-S0WD-Haier/tree/experimental
It is a very early test version, so I wouldn’t recommend installing it if you are not ready to deal with potential problems.
Edit from 26.12: I worked and tested the experimental branch passed week. Now it is more stable so I merged ex dev branch to the master and renamed the “experimental” branch to the dev
First of all why. It became tough to support the implementation of new functionality for hOn and almost impossible for smartAir2. New implementation should make the reuse of common code for both protocols much easier.
That is why I made a special library for working with Haier protocol: GitHub - paveldn/HaierProtocol: Haier communication protocol library. It contains code for the basic level of protocol (transport layer, timeouts, messages parsing, CRC, checksum, etc.). It is a pure C++ implementation without any relation to ESP Home. Potentially you can even write Windows or Linux applications to control your AC through the serial interface. It can be used for both hOn and smartAir2 (not tested yet!) protocols. Keep in mind that the library just “knows” how to talk to AC and the one who uses it should know what to “tell”.
The “Experimental” branch is an ESP home implementation using this library. It also has a lot of improvements and fixes. But as I said it should be “tuned” to be ready for mass usage.
So that is all the news :slight_smile:

2 Likes

Hi, newbie here, trying to create the firmware to upload into the ESP32 Haier module (hOn version) but can’t compile the firmware.
What I’ve done so far:
1.- Created a ./components folder into my “config/ESPHome” folder in Home Assistant and copied the files from Github “components/haier”
2.- Copied the file .Haier-base.yaml into the “config/ESPHome” folder in Home Assistant
3.- Created a new ESPHome device and added the code under haier.yaml

When Trying to compile Im getting this error:

What I am doing wrong? Thanks in advance for any help on this one!

external_components:
  - source: github://paveldn/ESP32-S0WD-Haier@dev
    components: [haier]
    refresh: 0s

you can include it like that and that way you do not need to download the components, but esphome will download it during the build

well, maybe rather without @dev :slight_smile:

yep, error is gone now, thanks a bunch!

So i’m trying to flash original haier adapter, even with no climate component I get bootloop snad Running on single core variant of a chip, but app is built with multi-core support.
I’m on windows and can’t get esp-idf as in example, so I do use arduino framework.

esphome:
  platformio_options:
    build_flags:
      - -DCONFIG_FREERTOS_UNICORE=true

didi not hlep, so I guess I will try to spin up linux to build on

hmm with esp-idf I get flash read err, weird

[20:53:53]rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[20:53:53]flash read err, 1000
[20:53:53]ets_main.c 371

@paveldn ESP32-S0WD-Haier dev branch when trying to build for the esp32-haier adapter (ESP32-S0WD)