Updated Haier integration documentation to support alarm triggers (#3474)

Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
This commit is contained in:
Pavlo Dudnytskyi 2023-12-21 01:10:53 +01:00 committed by GitHub
parent 64cccc6f10
commit 00f10d2b87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 91 additions and 40 deletions

View File

@ -2,14 +2,14 @@ Haier Climate
=============
.. seo::
:description: Instructions for setting up a Haier climate devices.
:description: Instructions for setting up Haier climate devices.
:image: air-conditioner.svg
This is an implementation of the ESPHome component to control HVAC on the base of the SmartAir2 and hOn Haier protocols (AC that is controlled by the hOn or SmartAir2 application).
There are two versions of the Haier protocol. The older one is using an application called SmartAir2 and the newer one - an application called hOn. Both protocols are compatible on the transport level but have different commands to control appliances.
There are two versions of the Haier protocol: the older version uses an application called SmartAir2 while the newer version uses an application called hOn. Both protocols are compatible on the transport level but utilize different commands to control appliances.
Older Haier models controlled by the SmartAir2 application are using the KZW-W002 module. This module cant be reused, and you need to replace it with an ESP (RPI pico w) module. The USB connector on a board doesnt support the USB protocol. It is a UART port that just uses a USB connector. To connect the ESP board to your AC you can cut a USB type A cable and connect wires to the climate connector.
Older Haier models controlled by the SmartAir2 application are using the KZW-W002 module. This module cant be reused, and you need to replace it with an ESP or RPI Pico W module. The USB connector on the board doesnt support the USB protocol. It is a UART port that just uses a USB connector. To connect the ESP board to your AC you can cut a USB type A cable and connect wires to the climate connector.
.. list-table:: Haier UART pinout
:header-rows: 1
@ -43,7 +43,7 @@ Older Haier models controlled by the SmartAir2 application are using the KZW-W00
Newer Haier models using a module called ESP32-for-Haier. It is an ESP32 single-core board with an ESP32-S0WD chip. In some cases, you can reuse this module and flash it with ESPHome, but some new modules dont support this. They look the same but have encryption enabled.
**Warning!** The new generation of ESP32-Haier devices has encryption enabled, so they can only be flashed with firmware that is signed with a private key. There is no way to make them work with ESPHome, so if you try to do it, the board will get into a boot loop with error ``rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)`` The only way to recover this board is to flash it with the original image. So before starting your experiments make a backup image.
**Warning!** The new generation of ESP32-Haier devices has encryption enabled, so they can only be flashed with firmware that is signed with a private key. There is no way to make them work with ESPHome, so if you try to do it, the board will get into a boot loop with the error ``rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)`` The only way to recover this board is to flash it with the original image. So before starting your experiments make a backup image.
.. figure:: images/haier_pinout.jpg
:align: center
@ -51,7 +51,7 @@ Newer Haier models using a module called ESP32-for-Haier. It is an ESP32 single-
ESP32-for-Haier UART0 pinout
Also, you can use any other ESP32, ESP8266 or a RPI pico W board. In this case, you will need to cut the original wire or make a connector yourself (the board has a JST SM04B-GHS-TB connector)
Also, you can use any other ESP32, ESP8266, or an RPI pico W board. In this case, you will need to cut the original wire or make a connector yourself (the board has a JST SM04B-GHS-TB connector)
This component requires a :ref:`uart` to be setup.
@ -92,10 +92,23 @@ This component requires a :ref:`uart` to be setup.
- VERTICAL
- HORIZONTAL
- BOTH
supported_presets:
- ECO
- BOOST
- SLEEP
supported_presets:
- AWAY
- ECO
- BOOST
- SLEEP
on_alarm_start:
then:
- logger.log:
level: WARN
format: "Alarm activated. Code: %d. Message: \"%s\""
args: [ code, message]
on_alarm_end:
then:
- logger.log:
level: INFO
format: "Alarm deactivated. Code: %d. Message: \"%s\""
args: [ code, message]
Configuration variables:
@ -103,14 +116,14 @@ Configuration variables:
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- **uart_id** (*Optional*, :ref:`config-id`): ID of the UART port to communicate with AC.
- **protocol** (*Optional*, string): Defines protocol of communication with AC. Possible values: hon or smartair2. Default value is smartair2.
- **protocol** (*Optional*, string): Defines communication protocol with AC. Possible values: hon or smartair2. The default value is smartair2.
- **name** (**Required**, string): The name of the climate device.
- **wifi_signal** (*Optional*, boolean): If true - send wifi signal level to AC.
- **answer_timeout** (*Optional*, :ref:`config-time`): Responce timeout. Default value is 200ms.
- **answer_timeout** (*Optional*, :ref:`config-time`): Responce timeout. The default value is 200ms.
- **alternative_swing_control** (*Optional*, boolean): (supported by smartAir2 only) If true - use alternative values to control swing mode. Use only if the original control method is not working for your AC.
- **control_packet_size** (*Optional*, int): (supported only by hOn) Define the size of the control packet. Can help with some newer models of ACs that use bigger packets. Default value: 10.
- **control_packet_size** (*Optional*, int): (supported only by hOn) Define the size of the control packet. Can help with some newer models of ACs that use bigger packets. The default value: 10.
- **control_method** (*Optional*, list): (supported only by hOn) Defines control method (should be supported by AC). Supported values: MONITOR_ONLY - no control, just monitor status, SET_GROUP_PARAMETERS - set all AC parameters with one command (default method), SET_SINGLE_PARAMETER - set each parameter individually (this method is supported by some new ceiling ACs like AD71S2SM3FA)
- **display** (*Optional*, boolean): Can be used to set AC display off.
- **display** (*Optional*, boolean): Can be used to set the AC display off.
- **beeper** (*Optional*, boolean): Can be used to disable beeping on commands from AC. Supported only by hOn protocol.
- **outdoor_temperature** (*Optional*): Temperature sensor for outdoor temperature. Supported only by hOn protocol.
@ -119,14 +132,52 @@ Configuration variables:
- All other options from :ref:`Sensor <config-sensor>`.
- **supported_modes** (*Optional*, list): Can be used to disable some of AC modes. Possible values: 'OFF', HEAT_COOL, COOL, HEAT, DRY, FAN_ONLY
- **supported_swing_modes** (*Optional*, list): Can be used to disable some swing modes if your AC does not support it. Possible values: 'OFF', VERTICAL, HORIZONTAL, BOTH
- **supported_presets** (*Optional*, list): Can be used to disable some presets. Possible values for smartair2 are: BOOST, COMFORT. Possible values for hOn are: ECO, BOOST, SLEEP
- **supported_presets** (*Optional*, list): Can be used to disable some presets. Possible values for smartair2 are: AWAY, BOOST, COMFORT. Possible values for hOn are: AWAY, ECO, BOOST, SLEEP. AWAY preset can be enabled only in HEAT mode, it is disabled by default
- **on_alarm_start (Optional, :ref:`Automation <automation>`):** (supported only by hOn) Automation to perform when AC activates a new alarm. See :ref:`haier-on_alarm_start`
- **on_alarm_end (Optional, :ref:`Automation <automation>`):** (supported only by hOn) Automation to perform when AC deactivates a new alarm. See :ref:`haier-on_alarm_end`
- All other options from :ref:`Climate <config-climate>`.
Automations
-----------
climate.haier.power_on Action
*****************************
.. _haier-on_alarm_start:
``on_alarm_start`` Trigger
**************************
This automation will be triggered when a new alarm is activated by AC. The error code of the alarm will be given in the variable "code" (type uint8_t), error message in the variable "message" (type char*). Those variables can be used in :ref:`lambdas <config-lambda>`
.. code-block:: yaml
climate:
- protocol: hOn
on_alarm_start:
then:
- logger.log:
level: WARN
format: "Alarm activated. Code: %d. Message: \"%s\""
args: [ code, message]
.. _haier-on_alarm_end:
``on_alarm_end`` Trigger
************************
This automation will be triggered when a previously activated alarm is deactivated by AC. The error code of the alarm will be given in the variable "code" (type uint8_t), error message in the variable "message" (type char*). Those variables can be used in :ref:`lambdas <config-lambda>`
.. code-block:: yaml
climate:
- protocol: hOn
on_alarm_end:
then:
- logger.log:
level: INFO
format: "Alarm deactivated. Code: %d. Message: \"%s\""
args: [ code, message]
``climate.haier.power_on`` Action
*********************************
This action turns AC power on.
@ -136,8 +187,8 @@ This action turns AC power on.
then:
climate.haier.power_on: device_id
climate.haier.power_off Action
******************************
``climate.haier.power_off`` Action
**********************************
This action turns AC power off
@ -147,8 +198,8 @@ This action turns AC power off
then:
climate.haier.power_off: device_id
climate.haier.power_toggle Action
*********************************
``climate.haier.power_toggle`` Action
*************************************
This action toggles AC power
@ -158,8 +209,8 @@ This action toggles AC power
then:
climate.haier.power_toggle: device_id
climate.haier.display_on Action
*******************************
``climate.haier.display_on`` Action
***********************************
This action turns the AC display on
@ -169,8 +220,8 @@ This action turns the AC display on
then:
climate.haier.display_on: device_id
climate.haier.display_off Action
********************************
``climate.haier.display_off`` Action
************************************
This action turns the AC display off
@ -180,8 +231,8 @@ This action turns the AC display off
then:
climate.haier.display_off: device_id
climate.haier.health_on Action
******************************
``climate.haier.health_on`` Action
**********************************
Turn on health mode (`UV light sterilization <https://www.haierhvac.eu/en/node/1809>`__)
@ -191,8 +242,8 @@ Turn on health mode (`UV light sterilization <https://www.haierhvac.eu/en/node/1
then:
climate.haier.health_on: device_id
climate.haier.health_off Action
*******************************
``climate.haier.health_off`` Action
***********************************
Turn off health mode
@ -202,8 +253,8 @@ Turn off health mode
then:
climate.haier.health_off: device_id
climate.haier.beeper_on Action
******************************
``climate.haier.beeper_on`` Action
**********************************
(supported only by hOn) This action enables beep feedback on every command sent to AC
@ -213,8 +264,8 @@ climate.haier.beeper_on Action
then:
climate.haier.beeper_on: device_id
climate.haier.beeper_off Action
*******************************
``climate.haier.beeper_off`` Action
***********************************
(supported only by hOn) This action disables beep feedback on every command sent to AC (keep in mind that this will not work for IR remote commands)
@ -224,8 +275,8 @@ climate.haier.beeper_off Action
then:
climate.haier.beeper_off: device_id
climate.haier.set_vertical_airflow Action
*****************************************
``climate.haier.set_vertical_airflow`` Action
*********************************************
(supported only by hOn) Set direction for vertical airflow if the vertical swing is disabled. Possible values: Health_Up, Max_Up, Up, Center, Down, Health_Down.
@ -237,8 +288,8 @@ climate.haier.set_vertical_airflow Action
id: device_id
vertical_airflow: Up
climate.haier.set_horizontal_airflow Action
*******************************************
``climate.haier.set_horizontal_airflow`` Action
***********************************************
(supported only by hOn) Set direction for horizontal airflow if the horizontal swing is disabled. Possible values: Max_Left, Left, Center, Right, Max_Right.
@ -250,8 +301,8 @@ climate.haier.set_horizontal_airflow Action
id: device_id
vertical_airflow: Right
climate.haier.start_self_cleaning Action
****************************************
``climate.haier.start_self_cleaning`` Action
********************************************
(supported only by hOn) Start `self-cleaning <https://www.haier.com/in/blogs/beat-the-summer-heat-with-haier-self-cleaning-ac.shtml>`__
@ -261,8 +312,8 @@ climate.haier.start_self_cleaning Action
then:
- climate.haier.start_self_cleaning: device_id
climate.haier.start_steri_cleaning Action
*****************************************
``climate.haier.start_steri_cleaning`` Action
*********************************************
(supported only by hOn) Start 56°C steri-cleaning