Tuya number: added description of new datapoint_hidden yaml key (#4010)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Piotr Szulc 2024-08-22 02:59:38 +02:00 committed by GitHub
parent b8582c08e5
commit 90cad7dcc8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 0 deletions

View File

@ -61,6 +61,23 @@ For instance, assume we have a pH sensor that reads from 0.00 to 15.00 with a sc
max_value: 15.00 max_value: 15.00
multiply: 100 multiply: 100
Hidden datapoints:
------------------
The above configurations will work fine as long as Tuya device publishes the datapoint value (along with its type) at initialization.
However this is not always the case. To be able to use such "hidden" datapoints as Number, you need to specify additional ``datapoint_hidden`` configuration block.
This block allows to specify the missing datapoint type and, optionally, the value that should be written to the datapoint at initialization.
.. code-block:: yaml
- platform: "tuya"
name: "Alarm at maximum"
number_datapoint: 116
min_value: 0
max_value: 100
datapoint_hidden:
datapoint_type: int
initial_value: 85
Configuration variables: Configuration variables:
------------------------ ------------------------
@ -69,6 +86,10 @@ Configuration variables:
- **max_value** (**Required**, float): The maximum value this number can be. - **max_value** (**Required**, float): The maximum value this number can be.
- **step** (*Optional*, float): The granularity with which the number can be set. Defaults to 1. - **step** (*Optional*, float): The granularity with which the number can be set. Defaults to 1.
- **multiply** (*Optional*, float): multiply the new value with this factor before sending the requests. - **multiply** (*Optional*, float): multiply the new value with this factor before sending the requests.
- **datapoint_hidden** (*Optional*): Specify information required for hidden datapoints.
- **datapoint_type** (**Required**, string): The datapoint type, one of *int*, *uint*, *enum*.
- **initial_value** (*Optional*, float): The value to be written at initialization. Must be between ``min_value`` and ``max_value``.
- All other options from :ref:`Number <config-number>`. - All other options from :ref:`Number <config-number>`.

View File

@ -140,5 +140,6 @@ See Also
- :doc:`/components/binary_sensor/tuya` - :doc:`/components/binary_sensor/tuya`
- :doc:`/components/sensor/tuya` - :doc:`/components/sensor/tuya`
- :doc:`/components/text_sensor/tuya` - :doc:`/components/text_sensor/tuya`
- :doc:`/components/number/tuya`
- :apiref:`tuya/tuya.h` - :apiref:`tuya/tuya.h`
- :ghedit:`Edit` - :ghedit:`Edit`