Tuya Select
The tuya select platform creates a select from a tuya serial component
and requires Tuya to be configured.
[08:51:09][C][tuya:032]: Tuya:[08:51:09][C][tuya:043]: Datapoint 1: switch (value: ON)[08:51:09][C][tuya:045]: Datapoint 24: int value (value: 220)[08:51:09][C][tuya:045]: Datapoint 16: int value (value: 22)[08:51:09][C][tuya:049]: Datapoint 2: enum (value: 1)[08:51:09][C][tuya:045]: Datapoint 19: int value (value: 40)[08:51:09][C][tuya:045]: Datapoint 101: int value (value: 1)[08:51:09][C][tuya:045]: Datapoint 27: int value (value: -2)[08:51:09][C][tuya:049]: Datapoint 43: enum (value: 1)[08:51:09][C][tuya:049]: Datapoint 102: enum (value: 1)[08:51:09][C][tuya:051]: Datapoint 45: bitmask (value: 0)[08:51:09][C][tuya:043]: Datapoint 10: switch (value: ON)[08:51:09][C][tuya:041]: Datapoint 38: raw (value: 06.00.14.08.00.0F.0B.1E.0F.0C.1E.0F.11.00.16.16.00.0F.08.00.16.17.00.0F (24))[08:51:09][C][tuya:049]: Datapoint 36: enum (value: 1)[08:51:09][C][tuya:057]: GPIO Configuration: status: pin 14, reset: pin 0 (not supported)[08:51:09][C][tuya:061]: Status Pin: GPIO14[08:51:09][C][tuya:063]: Product: '{"p":"gogb05wrtredz3bs","v":"1.0.0","m":0}'On this controller, the datapoint 36 represents the temperature sensor selection setting which is what we are interested in controlling using this platform.
Based on this, you can create the select as follows:
# Create a selectselect: - platform: "tuya" name: "Sensor selection" enum_datapoint: 2 optimistic: true options: 0: Internal 1: Floor 2: BothFor devices that use string datapoints, the configuration is simpler:
# Create a select with string datapointselect: - platform: "tuya" name: "Mode selection" string_datapoint: 5 options: - "auto" - "manual" - "eco"Configuration variables
Section titled “Configuration variables”-
enum_datapoint (Required, int): The enum datapoint id number for the select. Exactly one of enum_datapoint, int_datapoint, or string_datapoint must be set.
-
int_datapoint (Required, int): The int datapoint id number for the select. Exactly one of enum_datapoint, int_datapoint, or string_datapoint must be set.
-
string_datapoint (Required, int): The string datapoint id number for the select. Exactly one of enum_datapoint, int_datapoint, or string_datapoint must be set.
-
options (Required, Map[int, str] or List[str]): For enum_datapoint and int_datapoint, provide a mapping from values (int) to option names (str). For string_datapoint, provide a list of option names that match the string values sent by the device. Option names must be unique in either form.
-
optimistic (Optional, boolean): Whether to operate in optimistic mode - when in this mode, any command sent to the Select will immediately update the reported state.
-
All other options from Select.