Thanks again @paveldn for your work on this!
I have a KZW-W002, so SmartAir2 with a Haier 1U50MEEFRA (Haier Tundra Plus single-split airconditioning set - 5,0 kW).
Using a ESP32-WROOM-32U. Iām a C# developer, but not an ESPHome/hardware expert.
Try 3+ over the lats 2 years, sadly doesnāt work out this time either. It doesnāt initialize, it might be because of UART issues / misconfiguration. Hmm, at least the pin numbers look correct. And I think I have connected the TX/RX the right way, USB Green to RX on ESP, USB White on TX on ESP.
In the beginning I got stuck with the uart_id part, but when using āuart1ā it works. send_wifi is not needed for SmartAir2, but it doesnāt hurt.
Also couldnāt get it to work with the includes, despite commenting components: [haier]
, so I had to include the separate yaml partsā¦ Itās strange, because I see that it works for @rx78nt1alex
Most of the config file (removed irrelevant parts):
substitutions:
device_name: Haier AC
device_id: esphome4
uart_id: "uart1"
send_wifi: "true"
external_components:
- source:
type: git
url: https://github.com/paveldn/haier-esphome
esphome:
name: esphome4
platform: ESP32
board: esp32dev
logger:
level: VERBOSE
# Important, do not log over UART
baud_rate: 0
logs:
json: NONE
uart:
baud_rate: 9600
tx_pin: 1
rx_pin: 3
id: ${uart_id}
wifi:
use_address: esphome4.local
networks:
- ssid: !secret wifi_primary_ssid
password: !secret wifi_primary_pass
- ssid: !secret wifi_secondary_ssid
password: !secret wifi_secondary_pass
api:
services:
- service: turn_on
then:
- climate.haier.power_on: ${device_id}
- service: turn_off
then:
- climate.haier.power_off: ${device_id}
# services:
# - <<: !include configs/api/service.turn_on.yaml
# - <<: !include configs/api/service.turn_off.yaml
ota:
switch:
- platform: restart
name: "Esphome4 restart"
- platform: template
id: ${device_id}_display_switch
name: ${device_name} display
icon: mdi:led-on
entity_category: config
restore_state: yes
lambda: |-
return id(${device_id}).get_display_state();
turn_on_action:
climate.haier.display_on: ${device_id}
turn_off_action:
climate.haier.display_off: ${device_id}
- platform: template
id: ${device_id}_health_mode
name: ${device_name} health mode
icon: mdi:leaf
restore_state: yes
lambda: |-
return id(${device_id}).get_health_mode();
turn_on_action:
climate.haier.health_on: ${device_id}
turn_off_action:
climate.haier.health_off: ${device_id}
climate:
- platform: haier
id: ${device_id}
protocol: smartAir2
name: ${device_name}
uart_id: ${uart_id}
visual: # Optional, you can use it to limit min and max temperatures in UI (not working for remote!)
min_temperature: 16 Ā°C
max_temperature: 30 Ā°C
temperature_step: 1 Ā°C
supported_modes: # Optional, can be used to disable some modes if you don't need them
- 'OFF' # always available
- AUTO # always available
- COOL
- HEAT
- DRY
- FAN_ONLY
supported_swing_modes: # Optional, can be used to disable some swing modes if your AC does not support it
- 'OFF' # always available
- VERTICAL # always available
- HORIZONTAL
- BOTH
# switch:
# - <<: !include configs/switch/display.yaml
# - <<: !include configs/switch/health_mode.yaml
# - <<: !include configs/switch/restart.yaml
Part of the logs:
[13:00:00][D][sensor:127]: 'Esphome1 Uptime Sensor': Sending state 97.54100 s with 0 decimals of accuracy
[13:00:02][V][haier.climate:083]: Phase transition: SENDING_FIRST_STATUS_REQUEST => WAITING_FIRST_STATUS_ANSWER
[13:00:02][D][haier.protocol:019]: Sending frame: type 01, data: 4D 01
[13:00:02][V][haier.protocol:022]: Sending data: FF FF 0A 00 00 00 00 00 00 01 4D 01 59
[13:00:03][W][haier.climate:170]: Answer timeout for command 01, phase WAITING_FIRST_STATUS_ANSWER
[13:00:03][V][haier.climate:083]: Phase transition: WAITING_FIRST_STATUS_ANSWER => SENDING_INIT_1
[13:00:03][V][haier.climate:083]: Phase transition: SENDING_INIT_1 => SENDING_FIRST_STATUS_REQUEST
[13:00:12][V][haier.climate:083]: Phase transition: SENDING_FIRST_STATUS_REQUEST => WAITING_FIRST_STATUS_ANSWER
[13:00:12][D][haier.protocol:019]: Sending frame: type 01, data: 4D 01
[13:00:12][V][haier.protocol:022]: Sending data: FF FF 0A 00 00 00 00 00 00 01 4D 01 59
[13:00:13][W][haier.climate:170]: Answer timeout for command 01, phase WAITING_FIRST_STATUS_ANSWER
[13:00:13][V][haier.climate:083]: Phase transition: WAITING_FIRST_STATUS_ANSWER => SENDING_INIT_1
[13:00:13][V][haier.climate:083]: Phase transition: SENDING_INIT_1 => SENDING_FIRST_STATUS_REQUEST
```![20230528_130110|281x500](upload://vREVB7t5jXa5mJjBhWR8KUcX3Tn.jpeg)
Did you see something obviously wrong? Any things I can test / next steps?
Thanks again!