Skip to content

Commit

Permalink
Documentation updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavlo Dudnytskyi committed Jul 4, 2024
1 parent 5082e40 commit 61d9908
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 8 deletions.
26 changes: 22 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ Configuration variables:
- **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*, `Automation <https://esphome.io/guides/automations#automation>`_): (supported only by hOn) Automation to perform when AC activates a new alarm. See `on_alarm_start Trigger`_
- **on_alarm_end** (*Optional*, `Automation <https://esphome.io/guides/automations#automation>`_): (supported only by hOn) Automation to perform when AC deactivates a new alarm. See `on_alarm_end Trigger`_
- **on_status_message** (*Optional*, `Automation <https://esphome.io/guides/automations#automation>`_): Automation to perform when status message received from AC. See `on_status_message Trigger`_
- All other options from `Climate <https://esphome.io/components/climate/index.html#config-climate>`_.

Automations
Expand All @@ -131,7 +132,7 @@ Automations
``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 `lambdas <https://esphome.io/guides/automations#config-lambda>`_
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`` (``uint8_t``), error message in the variable ``message`` (``const char *``). Those variables can be used in `lambdas <https://esphome.io/guides/automations#config-lambda>`_

.. code-block:: yaml
Expand All @@ -142,14 +143,14 @@ This automation will be triggered when a new alarm is activated by AC. The error
- logger.log:
level: WARN
format: "Alarm activated. Code: %d. Message: \"%s\""
args: [ code, message]
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 `lambdas <https://esphome.io/guides/automations#config-lambda>`_
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`` (``uint8_t``), error message in the variable "message" (``const char *``). Those variables can be used in `lambdas <https://esphome.io/guides/automations#config-lambda>`_

.. code-block:: yaml
Expand All @@ -160,7 +161,24 @@ This automation will be triggered when a previously activated alarm is deactivat
- logger.log:
level: INFO
format: "Alarm deactivated. Code: %d. Message: \"%s\""
args: [ code, message]
args: [ 'code', 'message']
``on_status_message`` Trigger
*****************************

This automation will be triggered when component receives new status packet from AC. Raw message binary (without header and checksum) will be provided in the variable ``data`` (``const char *``), message length in the variable ``length`` (``uint8_t``). Those variables can be used in `lambdas <https://esphome.io/guides/automations#config-lambda>`_
This trigger can be used to support some features that unique for the model and not supported by others.

.. code-block:: yaml
climate:
- protocol: hOn
on_status_message:
then:
- logger.log:
level: INFO
format: "New status message received, size=%d, subcmd=%02X%02X"
args: [ 'data_size', 'data[0]', 'data[1]' ]
``climate.haier.power_on`` Action
*********************************
Expand Down
26 changes: 22 additions & 4 deletions docs/esphome-docs/climate/haier.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ Configuration variables:
- **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`
- **on_status_message** (*Optional*, :ref:`Automation <automation>`): Automation to perform when status message received from AC. See :ref:`haier-on_status_message`
- All other options from :ref:`Climate <config-climate>`.

Automations
Expand All @@ -133,7 +134,7 @@ Automations
``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>`
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`` (``uint8_t``), error message in the variable ``message`` (``const char *``). Those variables can be used in :ref:`lambdas <config-lambda>`

.. code-block:: yaml
Expand All @@ -144,14 +145,14 @@ This automation will be triggered when a new alarm is activated by AC. The error
- logger.log:
level: WARN
format: "Alarm activated. Code: %d. Message: \"%s\""
args: [ code, message]
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>`
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`` (``uint8_t``), error message in the variable "message" (``const char *``). Those variables can be used in :ref:`lambdas <config-lambda>`

.. code-block:: yaml
Expand All @@ -162,7 +163,24 @@ This automation will be triggered when a previously activated alarm is deactivat
- logger.log:
level: INFO
format: "Alarm deactivated. Code: %d. Message: \"%s\""
args: [ code, message]
args: [ 'code', 'message']
``on_status_message`` Trigger
*****************************

This automation will be triggered when component receives new status packet from AC. Raw message binary (without header and checksum) will be provided in the variable ``data`` (``const char *``), message length in the variable ``length`` (``uint8_t``). Those variables can be used in :ref:`lambdas <config-lambda>`
This trigger can be used to support some features that unique for the model and not supported by others.

.. code-block:: yaml
climate:
- protocol: hOn
on_status_message:
then:
- logger.log:
level: INFO
format: "New status message received, size=%d, subcmd=%02X%02X"
args: [ 'data_size', 'data[0]', 'data[1]' ]
``climate.haier.power_on`` Action
*********************************
Expand Down
1 change: 1 addition & 0 deletions docs/script/make_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def process_esphome_refs(line, l_num):
(":ref:`Automation <automation>`", "`Automation <https://esphome.io/guides/automations#automation>`_"),
(":ref:`haier-on_alarm_start`", "`on_alarm_start Trigger`_"),
(":ref:`haier-on_alarm_end`", "`on_alarm_end Trigger`_"),
(":ref:`haier-on_status_message`", "`on_status_message Trigger`_"),
(":ref:`Climate <config-climate>`", "`Climate <https://esphome.io/components/climate/index.html#config-climate>`_"),
(":ref:`lambdas <config-lambda>`", "`lambdas <https://esphome.io/guides/automations#config-lambda>`_"),
(":ref:`Sensor <config-sensor>`", "`Sensor <https://esphome.io/components/sensor/index.html#config-sensor>`_"),
Expand Down

0 comments on commit 61d9908

Please sign in to comment.