Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuya Number: description of the new restore_value key for hidden datapoints #4191

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions components/number/tuya.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ The above configurations will work fine as long as Tuya device publishes the dat
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.

TuyaMCU restores the state of all its datapoints after reboot, but with the hidden datapoints there is no way to know what their values are.
Therefore there is also an option to store them alson on esphome side and they will be set at initialization. To use this feature, set the ``restore_value`` yaml key to True.
szupi-ipuzs marked this conversation as resolved.
Show resolved Hide resolved

.. code-block:: yaml

- platform: "tuya"
Expand All @@ -77,6 +80,7 @@ This block allows to specify the missing datapoint type and, optionally, the val
datapoint_hidden:
datapoint_type: int
initial_value: 85
restore_value: yes

Configuration variables:
------------------------
Expand All @@ -90,6 +94,7 @@ Configuration variables:

- **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``.
- **restore_value** (*Optional*, boolean): Saves and loads the state to RTC/Flash. The default is False.
szupi-ipuzs marked this conversation as resolved.
Show resolved Hide resolved

- All other options from :ref:`Number <config-number>`.

Expand Down