diff --git a/.HA_VERSION b/.HA_VERSION index 110ab1ad..aa240b72 100644 --- a/.HA_VERSION +++ b/.HA_VERSION @@ -1 +1 @@ -2023.11.3 \ No newline at end of file +2023.12.0 \ No newline at end of file diff --git a/custom_components/powercalc/manifest.json b/custom_components/powercalc/manifest.json index b6c45a48..b2f819bf 100644 --- a/custom_components/powercalc/manifest.json +++ b/custom_components/powercalc/manifest.json @@ -22,5 +22,5 @@ "requirements": [ "numpy>=1.21.1" ], - "version": "v1.9.8" + "version": "v1.9.9" } \ No newline at end of file diff --git a/custom_components/powercalc/sensors/group.py b/custom_components/powercalc/sensors/group.py index e963497c..efee531c 100644 --- a/custom_components/powercalc/sensors/group.py +++ b/custom_components/powercalc/sensors/group.py @@ -496,7 +496,9 @@ async def async_added_to_hass(self) -> None: ) except DecimalException as err: _LOGGER.warning( - "%s: Could not restore last state: %s", self.entity_id, err, + "%s: Could not restore last state: %s", + self.entity_id, + err, ) state_listener = Throttle(timedelta(seconds=30))(state_listener) diff --git a/custom_components/powercalc/sensors/power.py b/custom_components/powercalc/sensors/power.py index 9883fefd..6fcc7e35 100644 --- a/custom_components/powercalc/sensors/power.py +++ b/custom_components/powercalc/sensors/power.py @@ -324,6 +324,7 @@ def __init__( ) -> None: """Initialize the sensor.""" self._calculation_strategy = calculation_strategy + self._calculation_enabled_condition: Template | None = None self._source_entity = source_entity self._attr_name = name self._power: Decimal | None = None @@ -380,6 +381,7 @@ async def async_added_to_hass(self) -> None: await super().async_added_to_hass() await self.ensure_strategy_instance() assert self._strategy_instance is not None + self.init_calculation_enabled_condition() async def appliance_state_listener(event: Event) -> None: """Handle for state changes for dependent sensors.""" @@ -444,6 +446,10 @@ async def initial_update(hass: HomeAssistant) -> None: if isinstance(self._standby_power, Template): self._standby_power.hass = self.hass track_templates.append(TrackTemplate(self._standby_power, None, None)) + if self._calculation_enabled_condition: + track_templates.append( + TrackTemplate(self._calculation_enabled_condition, None, None) + ) if track_templates: async_track_template_result( self.hass, @@ -463,6 +469,21 @@ def async_update(event_time: datetime | None = None) -> None: async_track_time_interval(self.hass, async_update, self._update_frequency) + def init_calculation_enabled_condition(self) -> None: + if CONF_CALCULATION_ENABLED_CONDITION not in self._sensor_config: + return + + template = self._sensor_config.get(CONF_CALCULATION_ENABLED_CONDITION) + if isinstance(template, str): + template = template.replace("[[entity]]", self.source_entity) + template = Template(template) + + if not isinstance(template, Template): + _LOGGER.error("Invalid calculation_enabled_condition: %s", template) + return + + self._calculation_enabled_condition = template + async def _handle_source_entity_state_change( self, trigger_entity_id: str, @@ -620,17 +641,10 @@ def _update_sleep_power(*_: Any) -> None: # noqa: ANN401 return standby_power async def is_calculation_enabled(self) -> bool: - if CONF_CALCULATION_ENABLED_CONDITION not in self._sensor_config: + template = self._calculation_enabled_condition + if not template: return True - template = self._sensor_config.get(CONF_CALCULATION_ENABLED_CONDITION) - if isinstance(template, str): - template = template.replace("[[entity]]", self.source_entity) - template = Template(template) - - if not isinstance(template, Template): - return True # pragma: no cover - template.hass = self.hass return bool(template.async_render()) diff --git a/custom_components/tuya_local/devices/README.md b/custom_components/tuya_local/devices/README.md index ed55097d..881236d5 100644 --- a/custom_components/tuya_local/devices/README.md +++ b/custom_components/tuya_local/devices/README.md @@ -1,682 +1,682 @@ -# Device Configuration Files - -This directory contains device configuration files, describing the workings -of supported devices. The files are in YAML format, and describe the mapping -of Tuya DPs (Data Points) to HomeAssistant attributes. - -Each Tuya device may correspond to one primary entity and any number of -secondary entities in Home Assistant. - -## The Top Level - -The top level of the device configuration defines the following: - -### `name` - -The device should be named descriptively with a name the user would recognize, -the brand and model of the device is a good choice. If a whole family of -devices is supported, a generalization of the model type can be used. -The name should also indicate to the user what type of device it is. - -### `products` - -*Optional, for future use.* - -A list of products that this config applies to. Each product in the list must -have an `id` specified, which corresponds to the productId or productKey -(depending on where you are getting it from) in Tuya info. This is available -from the Tuya developer web portal listing for your device, or when using -UDP discovery (via tinytuya). In future it is intended that UDP discovery -will be used to more precisely match devices to configs, so it is recommended -to report these if you can find them when requesting a new device. Each -listing can also have an optional `name`, which is intended to override the -top level `name` when full support for this field is added. -Probably other info will be added in future to provide better reporting of -device manufacturer and model etc. - -### `primary_entity` - -This contains the configuration for one Home Assistant entity which is -considered the main entity for the device. For example, if the device is -a heater, this would be a climate entity. - -The configuration for entities is detailed in its own section below. - -### `secondary_entities` - -*Optional.* - -This contains a list of additional Home Assistant entities -providing additional functionality beyond the capabilities of the primary -entity. Examples include lighting control for display panels as a Home -Assistant light entity, child locks as a Home Assistant lock entity, -or additional toggles as Home Assistant switch entities. - -The configuration for secondary entities is the same as primary entities, -and is detailed in the section below. - -## Entity configuration - -### `entity` - -The Home Assistant entity type being configured. Currently supported -types are **climate**, **switch**, **light**, **lock**. Functionality -for these entities is limited to that which has been required for the -devices until now and may need to be extended for new devices. In -particular, the light and lock entities have only been used for simple -secondary entities, so only basic functionality is implemented. - -### `class` - -*Optional.* - -For some entity types, a device `class` can be set, for example `switch` -entities can have a class of `outlet`. This may slightly alter the UI -behaviour. -For most entities, it will alter the default icon, and for binary sensors -also the state that off and on values translate to in the UI. - -### `category` - -*Optional.* - -This specifies the `entity category` of the entity. Entities can be categorized -as `config` or `diagnostic` to restrict where they appear automatically in -Home Assistant. - -### `dps` - -This is a list of the definitions for the Tuya DPs associated with -attributes of this entity. There should be one list entry for each -supported DPs reported by the device. - -The configuration of DPs entries is detailed in its own section below. - -### `name` - -*Optional.* - -The name associated with this entity can be set here. If no name is set, -it will inherit the name at the top level. This is mostly useful for -overriding the name of secondary entities to give more information -about the purpose of the entity, as the generic type with the top level -name may not be sufficient to describe the function. - -### `mode` - -*Optional. For number entities, default="auto", for others, None* - -For number entities, this can be used to force `slider` or `box` as the -input method. The default `auto` uses a slider if the range is small enough, -or a box otherwise. - -## DPs configuration - -### `id` - -Every DP must have a numeric ID matching the DP ID in the Tuya protocol. - -### `type` - -The type of data returned by the Tuya API. Can be one of the following: - - - **string** can contain arbitrary text. - - **boolean** can contain the values **True** or **False**. - - **integer** can contain only numbers. Integers can have range set on them, be scaled and steped - - **bitfield** is a special case of integer, where the bits that make up the value each has individal meaning. - - **unixtime** is a special case of integer, where the device uses a unix timestamp (seconds since 1970-01-01 00:00), which is converted to a datetime for Home Assistant - - **base64** is a special case of string, where binary data is base64 encoded. Platforms that use this type will need special handling to make sense of the data. - - **hex** is a special case of string, where binary data is hex encoded. Platforms that use this type will need special handling to make sense of the data. - - **json** is a special case of string, where multiple data points are encoded in json format in the string. Platforms that use this type will need special handling to make sense of the data. - - **float** can contain floating point numbers. No known devices use this, but it is supported if needed. - -### `name` - -The name given to the attribute in Home Assistant. Certain names are used -by the Home Assistant entities for specific purposes. If a name is not -recognized as a standard attribute by the entitiy implementation, the -attribute will be returned as a readonly custom attribute on the entity. -If you need non-standard attributes to be able to be set, you will need -to use a secondary entity for that. - -### `readonly` - -*Optional, default false.* - -A boolean setting to mark attributes as readonly. If not specified, the -default is `false`. If set to `true`, the attributes will be reported -to Home Assistant, but attempting to set them will result in an error. -This is only needed in contexts where it would normally be possible to set -the value. If you are creating a sensor entity, or adding an attribute of an -entity which is inherently read-only, then you do not need to specify this. - -### `optional` - -*Optional, default false.* - -A boolean setting to mark attributes as optional. This allows a device to be -matched even if it is not sending the dp at the time when adding a new device. -It can also be used to match a range of devices that have variations in the extra -attributes that are sent. - -### `persist` - -*Optional, default true.* - -Whether to persist the value if the device does not return it on every status -refresh. Some devices don't return every value on every status poll. In most -cases, it is better to remember the previous value, but in some cases the -dp is used to signal an event, so when it is next sent, it should trigger -automations even if it is the same value as previously sent. In that case -the value needs to go to null in between when the device is not sending it. - -### `force` - -*Optional, default false.* - -A boolean setting to mark dps as requiring an explicit update request -to fetch. Many energy monitoring smartplugs require this, without a -explicit request to update them, such plugs will only return monitoring data -rarely or never. Devices can misbehave if this is used on dps that do not -require it. Use this only where needed, and generally only on read-only dps. - -### `precision` - -*Optional, default None.* - -For integer dps that are sensor values, the suggested precision for -display in Home Assistant can be specified. If unspecified, the Home -Assistant will use the native precision, which is calculated based on -the scale of the dp so as to provide distinct values with as few -decimal places as possible. For example a scale of 3 will result in -one decimal place by default, (values displayed as x.3, x.7 rather -than x.33333333 and x.666666) but you could override that to 2 or 0 -with by specifying the precision explicitly. - -### `mapping` - -*Optional. Must be a list with each item starting with a `- ` (a dash and a space):* -This can be used to define a list of additional rules that modify the DP -to Home Assistant attribute mapping to something other than a one to one -copy. - -The rules can range from simple value substitution to complex -relationships involving other attributes. It can also be used to change -the icon of the entity based on the attribute value. Mapping rules are -defined in their own section below. - -### `hidden` - -*Optional, default false.* -This can be used to define DPs that do not directly expose Home Assistant -attributes. When set to **true**, no attribute will be sent. A `name` should -still be specified and the attribute can be referenced as a `constraint` -from mapping rules on other attributes to implement complex mappings. - -An example of use is a climate device, where the Tuya device keeps separate -temperature settings for different Normal and Eco preset modes. The Normal -temperature setting is exposed through the standard `temperature` -Home Assistant attribute on the climate device, but the `eco_temperature` -setting on a different DP is set to hidden. Mapping Rules are used on the -`temperature` attribute to redirect to `eco_temperature` when `preset_mode` -is set to Eco. - -### `range` - -*Optional, may be required in some contexts, may have defaults in others.* - -For integer attributes that are not readonly, a range can be set with `min` -and `max` values that will limit the values that the user can enter in the -Home Assistant UI. This can also be set in a `mapping` or `conditions` block. - -### `unit` - -*Optional, default="C" for temperature dps on climate devices.* - -For temperature dps, some devices will use Fahrenhiet. This needs to be -indicated back to HomeAssistant by defining `unit` as "F". For sensor -entities, see the HomeAssistant developer documentation for the full list -of possible units (C and F are automatically translated to their Unicode -equivalents, other units are currently ASCII so can be easily entered directly). - -### `class` - -*Optional.* - -For sensors, this sets the state class of the sensor (measurement, total -or total_increasing) - - -### `format` - -*Optional.* - -For base64 and hex types, this specifies how to decode the binary data (after hex or base64 decoding). -This is a container field, the contents of which should be a list consisting of `name`, `bytes` and `range` fields. `range` is as described above. `bytes` is the number of bytes for the field, which can be `1`, `2`, or `4`. `name` is a name for the field, which will have special handling depending on -the device type. - -### `mask` - -*Optional.* - -For base64 and hex types, this specifies how to extract a single numeric value from the binary data. The value should be a hex bit mask (eg 00FF00 to extract the middle byte of a 3 byte value). Unlike format, this does not require special handling in the entity platform, as only a single value is being extracted. - -### `endianness` - -*Optional, default="big"* - -For base64 and hex types, this specifies the endianess of the data and mask. Could be "big" or "little". - -## Mapping Rules - -Mapping rules can change the behavior of attributes beyond simple -copying of DP values to attribute values. Rules can be defined -without a dps_val to apply to all values, or a list of rules that -apply to particular dp values can be defined to change only -particular cases. Rules can even depend on the values of other -elements. - -### `dps_val` - -*Optional, if not provided, the rule is a default that will apply to all -values not covered by their own dps_val rule.* - -`dps_val` defines the DP value that each -rule in the list applies to. This can be used to map specific values from the -Tuya protocol into attribute values that have specific meaning in Home -Assistant. For example, climate entities in Home Assistant define modes -"off", "heat", "cool", "heat_cool", "auto" and "dry". But in the Tuya protocol, -a simple heater just has a boolean off/on switch. It can also be used to -change the icon when a specific mode is operational. For example if -a heater device has a fan-only mode, you could change the icon to "mdi:fan" -instead of "mdi:radiator" when in that mode. -A `dps_val` of `null` can be used to specify a value to be assumed when a -dp is not being returned by the device, to avoid None in some locations where -that causes an issue such as entities showing as unavailable. Such a mapping -is one-way, the value will not be mapped back to a null when setting the dp. - -### `value` - -*Optional.* - -This can be used to set the attribute value seen by Home Assistant to something -different than the DP value from the Tuya protocol. Normally it will be used -with `dps_val` to map from one value to another. Without `dps_val` it will -one-way map all otherwise unmapped dps values to the specified value. This -can be useful for a binary_sensor. - -### `hidden` - -*Optional, default=false* - -When set to true, the mapping value is hidden from the list of all values. -This can be used for items that should not be available for selection by the -user but you still want to map for feedback coming from the device. For -example, some devices have a "Manual" mode, which is automatically selected -when adjustments are made to other settings, but should not be available as -an explicit mode for the user to select. - -### `scale` - -*Optional, default=1.* - -This can be used in an `integer` dp mapping to scale the values. For example -some climate devices represent the temperature as an integer in tenths of -degrees, and require a scale of 10 to convert them to degrees expected by -Home Assistant. The scale can also be the other way, for a fan with speeds -1, 2 and 3 as DP values, this can be converted to a percentage with a scale -of 0.03. - -### `invert` - -*Optional, default=False.* - -This can be used in an `integer` dp mapping to invert the range. For example, -some cover devices have an opposite idea of which end of the percentage scale open -and closed are from what Home Assistant assumes. To use this mapping option, a range -must also be specified for the dp. - -### `step` - -*Optional, default=1.* - -This can be used in an `integer` dp mapping to make values jump by a specific -step. It can also be set in a conditions block so that the steps change only -under certain conditions. An example is where a value has a range of 0-100, but -only allows settings that are divisible by 10, so a step of 10 would be set. - -### `target_range` - -*Optional, has `min` and `max` child attributes, like `range`* - -A target range is used together with `range` on a numeric value, to -map the value into a new range. Unlike `scale`, this can shift the -value as well as scale it into the new range. Color temperature is a -major use of this, as Tuya devices often use a range of 0 - 100, 0 - -255 or 0 - 1000, and this needs to be mapped to the Kelvin like 2200 - -6500. - -This should normally only be used on a default mapping, as the code -that uses this feature often needs to inform HA of the min and max -values for the UI, which may not handle multipe different mappings -across the range. - -### `icon` - -*Optional.* - -This can be used to override the icon. Most useful with a `dps_val` which -indicates a change from normal operating mode, such as "fan-only", -"defrosting", "tank-full" or some error state. - -### `icon_priority` - -*Optional. Default 10. Lower numbers mean higher priorities.* - -When a number of rules on different attributes define `icon` changes, you -may need to control which have priority over the others. For example, -if the device is off, probably it is more important to indicate that than -whether it is in fan-only or heat mode. So in the off/on DP, you might -give a priority of 1 to the off icon, 3 to the on icon, and in the mode DP -you could give a priority of 2 to the fan icon, to make it override the -normal on icon, but not the off icon. -If you don't specify any priorities, the icons will all get the same priority, -so if any overlap exists in the rules, it won't always be predictable which -icon will be displayed. - -### `value_redirect` - -*Optional.* - -When `value_redirect` is set, the value of the attribute and any attempt to -set it will be redirected to the named attribute instead of the current one. - -An example of how this can be useful is where a Tuya heater has a dp for the -target temperature in normal mode, and a different dp for the target -temperature is "eco" mode. Depending on the `preset_mode`, you need to use -one or the other. But Home Assistant just has one `temperature` attribute for -setting target temperature, so the mapping needs to be done before passing to -Home Assistant. - -### `value_mirror` - -*Optional.* - -When `value_mirror` is set, the value of the attribute will be redirected to -the current value of the named attribute. Unlike `value_redirect`, this does -not redirect attempts to set the dp to the redirected dp, but when used in -a map, this can make the mapping dynamic. - -An example of how this can be useful is where a thermostat can be configured -to control either a heating or cooling device, but it is not expected to -change this setting during operation. Once set up, the hvac_mode dp can -have a mapping that mirrors the value of the configuration dp. - -### `invalid` - -*Optional, default false.* - -Invalid set to true allows an attribute to temporarily be set read-only in -some conditions. Rather than passing requests to set the attribute through -to the Tuya protocol, attempts to set it will throw an error while it meets -the conditions to be `invalid`. It does not make sense to set this at mapping -level, as it would cause a situation where you can set a value then not be -able to unset it. Instead, this should be used with conditions, below, to -make the behaviour dependent on another DP, such as disabling fan speed -control when the preset is in sleep mode (since sleep mode should force low). - -### `default` - -*Optional, default false.* - -Default set to true allows an attribute to be set as the default value. -This is used by some entities when an argument is not provided to a service call -but the attribute is required to be set to function correctly. -An example is the siren entity which uses the tone attribute to turn on and -off the siren, but when turn_on is called without any argument, it needs to -pick a default tone to use to turn on the siren. - -### `constraint` - -*Optional, always paired with `conditions`. Default if unspecified is the current attribute* - -If a rule depends on an attribute other than the current one, then `constraint` -can be used to specify the element that `conditions` applies to. `constraint` can also refer back to the same attribute - this can be useful for specifying conditional mappings, for example to support two different variants of a device in a single config file, where the only difference is the way they represent enum attributes. - -### `conditions` - -*Optional, usually paired with `constraint.`* - -Conditions defines a list of rules that are applied based on the `constraint` attribute. The contents are the same as Mapping Rules, but `dps_val` applies to the attribute specified by `constraint`, and also can be a list of values to match as well rather than a single value. All others act on the current attribute as they would in the mapping. Although conditions are specified within a mapping, they can also contain a `mapping` of their own to override that mapping. These nested mappings are limited to simple `dps_val` to `value` substitutions, as more complex rules would quickly become too complex to manage. - -When setting a dp which has conditions attached, the behaviour is slightly different depending on whether the constraint dp is readonly or not. - -For non-readonly constraints that specify a single dps_val, the constraint dp will be set along with the target dp so that the first condition with a value matching the target value is met. - -For readonly constraints, the condition must match the constraint dp's current value for anything to be set. - -**Example** -```yaml - ... - name: target_dp - mapping: - - dps_val: 1 - constraint: constraint_dp - conditions: - - dps_val: a - value: x - - dpa_val: c - value: z - - dps_val: 2 - constraint: constraint_dp - conditions: - - dps_val: b - value: x - - dps_val: c - value: y -``` -If `constraint_dp` is not readonly: - -| constraint_dp current dps_val | target_dp target value | dps set | -|---|---|---| -| a | x | target_dp: 1, constraint_dp: a | -| a | y | target_dp: 2, constraint_dp: c | -| a | z | target_dp: 1, constraint_dp: c | -| b | x | target_dp: 1, constraint_dp: a | -| b | y | target_dp: 2, constraint_dp: c | -| b | z | target_dp: 1, constraint_dp: c | -| c | x | target_dp: 1, constraint_dp: a | -| c | y | target_dp: 2, constraint_dp: c | -| c | z | target_dp: 1, constraint_dp: c | - -If `constraint_dp` is readonly: - -| current constraint_dp | target target_dp | dps set | -|---|---|---| -| a | x | target_dp: 1 | -| a | y | - | -| a | z | - | -| b | x | target_dp: 2 | -| b | y | - | -| b | z | - | -| c | x | - | -| c | y | target_dp: 2 | -| c | z | target_dp: 1 | - - - -## Entity types - -Entities have specific mappings of dp names to functions. Any unrecognized dp name is added -to the entity as a read-only extra attribute, so can be observed and queried from HA, but if you need -to be able to change it, you should split it into its own entity of an appropriate type (number, select, switch for example). - -If the type of dp does not match the expected type, a mapping should be provided to convert. -Note that "on" and "off" require quotes in yaml, otherwise it they are interpretted as true/false. - -Many entity types support a class attribute which may change the UI behaviour, icons etc. See the -HA documentation for the entity type to see what is valid (these may expand over time) - -### `alarm_control_panel` -- **alarm_state** (required, string) the alarm state, used to report and change the current state of the alarm. Expects values from the set `disarmed`, `armed_home`, `armed_away`, `armed_night`, `armed_vacation`, `armed_custom_bypass`, `pending`, `arming`, `disarming`, `triggered`. Other states are allowed for read-only status, but only the armed... and disarmed states are available as commands. -- **trigger** (optional, boolean) used to trigger the alarm remotely for test or panic button etc. - -### `binary_sensor` -- **sensor** (required, boolean) the dp to attach to the sensor. - -### `button` -- **button** (required, boolean) the dp to attach to the button. Any -read value will be ignored, but the dp is expected to be present for -device detection unless set to optional. A value of true will be sent -for a button press, map this to the desired dps_val if a different -value is required. - -### `climate` -- **aux_heat** (optional, boolean) a dp to control the aux heat switch if the device has one. -- **current_temperature** (optional, number) a dp that reports the current temperature. -- **current_humidity** (optional, number) a dp that reports the current humidity (%). -- **fan_mode** (optional, mapping of strings) a dp to control the fan mode if available. - Any value is allowed, but HA has some standard modes: - `"on", "off", auto, low, medium, high, top, middle, focus, diffuse` -- **humidity** (optional, number) a dp to control the target humidity if available. (%) -- **hvac_mode** (optional, mapping of strings) a dp to control the mode of the device. - Possible values are: `"off", cool, heat, heat_cool, auto, dry, fan_only` -- **hvac_action** (optional, string) a dp thar reports the current action of the device. - Possible values are: `"off", idle, cooling, heating, drying, fan` -- **preset_mode** (optional, mapping of strings) a dp to control preset modes of the device. - Any value is allowed, but HA has some standard presets: - `none, eco, away, boost, comfort, home, sleep, activity` -- **swing_mode** (optional, mapping of strings) a dp to control swing modes of the device. - Possible values are: `"off", vertical, horizontal` -- **temperature** (optional, number) a dp to set the target temperature of the device. - A unit may be specified as part of the attribute if a temperature_unit dp is not available, if not - the default unit configured in HA will be used. -- **target_temp_high** (optional, number) a dp to set the upper temperature range of the device. - This dp should be paired with `target_temp_low`, and is mutually exclusive with `temperature` -- **target_temp_low** (optional, number) a dp to set the lower temperature range of the device. -- **temperature_unit** (optional, string) a dp that specifies the unit the device is configured for. - Values should be mapped to "C" or "F" (case sensitive) - often the device will use a boolean or - lower case for this -- **min_temperature** (optional, number) a dp that specifies the minimum temperature that can be set. Some devices provide this, otherwise a fixed range on the temperature dp can be used. -- **max_temperature** (optional, number) a dp that specifies the maximum temperature that can be set. - -### `cover` - -Either **position** or **open** should be specified. - -- **position** (optional, number 0-100): a dp to control the percentage that the cover is open. - 0 means completely close, 100 means completely open. -- **control** (optional, mapping of strings): a dp to control the cover. Mainly useful if **position** cannot be used. - Valid values are `open, close, stop` -- **action** (optional, string): a dp that reports the current state of the cover. - Special values are `opening, closing` -- **open** (optional, boolean): a dp that reports if the cover is open. Only used if **position** is not available. - -### `fan` -- **switch** (optional, boolean): a dp to control the power state of the fan -- **preset_mode** (optional, mapping of strings): a dp to control different modes of the fan. - Values `"off", low, medium, high` used to be handled specially by HA as deprecated speed aliases. If these are the only "presets", consider mapping them as **speed** values instead, as voice assistants will respond to phrases like "turn the fan up/down" for speed. -- **speed** (optional, number 0-100): a dp to control the speed of the fan (%). - scale and step can be used to convert smaller ranges to percentages, or a mapping for discrete values. -- **oscillate** (optional, boolean): a dp to control whether the fan will oscillate or not. -- **direction** (optional, string): a dp to control the spin direction of the fan. - Valid values are `forward, reverse`. - -### `humidifier` -Humidifer can also cover dehumidifiers (use class to specify which). - -- **switch** (optional, boolean): a dp to control the power state of the fan -- **mode** (optional, mapping of strings): a dp to control preset modes of the device -- **humidity** (optional, number): a dp to control the target humidity of the device -- **current_humidity** (optional, number): a dp to report the current humidity measured by the device - -### `light` -- **switch** (optional, boolean): a dp to control the on/off state of the light -- **brightness** (optional, number 0-255): a dp to control the dimmer if available. -- **color_temp** (optional, number): a dp to control the color temperature if available. See `target_range` above for mapping Tuya's range into Kelvin. - -- **rgbhsv** (optional, hex): a dp to control the color of the light, using encoded RGB and HSV values. The `format` field names recognized for decoding this field are `r`, `g`, `b`, `h`, `s`, `v`. -- **color_mode** (optional, mapping of strings): a dp to control which mode to use if the light supports multiple modes. - Special values: `white, color_temp, hs, xy, rgb, rgbw, rgbww`, others will be treated as effects, - Note: only white, color_temp and hs are currently supported, others listed above are reserved and may be implemented in future when the need arises. - If no `color_mode` dp is available, a single supported color mode will be - calculated based on which of the above dps are available. -- **effect** (optional, mapping of strings): a dp to control effects / presets supported by the light. - Note: If the light mixes in color modes in the same dp, `color_mode` should be used instead. If the light contains both a separate dp for effects/scenes/presets and a mix of color_modes and effects (commonly scene and music) in the `color_mode` dp, then a separate select entity should be used for the dedicated dp to ensure the effects from `color_mode` are selectable. - -### `lock` - -The unlock... dps below are normally integers, but can also be boolean, in which case -no information will be available about which specific credential was used to unlock the lock. - -- **lock** (optional, boolean): a dp to control the lock state: true = locked, false = unlocked -- **unlock_fingerprint** (optional, integer): a dp to identify the fingerprint used to unlock the lock. -- **unlock_password** (optional, integer): a dp to identify the password used to unlock the lock. -- **unlock_temp_pwd** (optional, integer): a dp to identify the temporary password used to unlock the lock. -- **unlock_dynamic_pwd** (optional, integer): a dp to identify the dynamic password used to unlock the lock. -- **unlock_offline_pwd** (optional, integer): a dp to identify the offline password used to unlock the lock. -- **unlock_card** (optional, integer): a dp to identify the card used to unlock the lock. -- **unlock_app** (optional, integer): a dp to identify the app used to unlock the lock. -- **unlock_key** (optional, integer): a dp to identify the key used to unlock the lock. -- **unlock_ble** (optional, integer): a dp to identify the BLE device used to unlock the lock. -- **unlock_voice** (optional, integer): a dp to identify the voice assistant user used to unlock the lock. -- **request_unlock** (optional, integer): a dp to signal that a request has been made to unlock, the value should indicate the time remaining for approval. -- **approve_unlock** (optional, boolean): a dp to unlock the lock in response to a request. -- **request_intercom** (optional, integer): a dp to signal that a request has been made via intercom to unlock, the value should indicate the time remaining for approval. -- **approve_intercom** (optional, boolean): a dp to unlock the lock in response to an intercom request. -- **jammed** (optional, boolean): a dp to signal that the lock is jammed. - -### `number` -- **value** (required, number): a dp to control the number that is set. -- **unit** (optional, string): a dp that reports the units returned by the number. - This may be useful for devices that switch between C and F, otherwise a fixed unit attribute on the **value** dp can be used. -- **minimum** (optional, number): a dp that reports the minimum the number can be set to. - This may be used as an alternative to a range setting on the **value** dp if the range is dynamic -- **maximum** (optional, number): a dp that reports the maximum the number can be set to. - This may be used as an alternative to a range setting on the **value** dp if the range is dynamic - -### `select` -- **option** (required, mapping of strings): a dp to control the option that is selected. - -### `sensor` -- **sensor** (required, number or string): a dp that returns the current value of the sensor. -- **unit** (optional, string): a dp that returns the unit returned by the sensor. - This may be useful for devices that switch between C and F, otherwise a fixed unit attribute on the **sensor** dp can be used. - -### `siren` -- **tone** (required, mapping of strings): a dp to report and control the siren tone. As this is used to turn on and off the siren, it is required. If this does not fit your siren, the underlying implementation will need to be modified. -The value "off" will be used for turning off the siren, and will be filtered from the list of available tones. One value must be marked as `default: true` so that the `turn_on` service with no commands works. -- **volume** (optional, float in range 0.0-1.0): a dp to control the volume of the siren (probably needs a scale and step applied, since Tuya devices will probably use an integer, or strings with fixed values). -- **duration** (optional, integer): a dp to control how long the siren will sound for. - -### `switch` -- **switch** (required, boolean): a dp to control the switch state. - -### `vacuum` -- **status** (required, mapping of strings): a dp to report and control the status of the vacuum. -- **command** (optional, mapping of strings): a dp to control the statuss of the vacuum. If supplied, the status dp is only used to report the state. - Special values: `return_to_base, clean_spot`, others are sent as general commands -- **locate** (optional, boolean): a dp to trigger a locator beep on the vacuum. -- **power** (optional, boolean): a dp to switch full system power on and off -- **activate** (optional, boolean): a dp to start and pause the vacuum -- **direction_control** (optional, mapping of strings): a dp that is used for directional commands - These are additional commands that are not part of **status**. They can be sent as general commands from HA. -- **error** (optional, bitfield): a dp that reports error status. - As this is mapped to a single "fault" state, you could consider separate binary_sensors to report on individual errors - -### `water_heater` -- **current_temperature** (optional, number): a dp that reports the current water temperature. - -- **operation_mode** (optional, mapping of strings): a dp to report and control the operation mode of the water heater. If `away` is one of the modes, another mode must be marked as `default: true` to that the `away_mode_off` service knows which mode to switch out of away mode to. - -- **temperature** (optional, number): a dp to control the target water temperature of the water heater. A unit may be specified as an attribute if the `temperature_unit` dp is not available, otherwise the default of HA's current setting will be used. - -- **temperature_unit** (optional, string): a dp that reports the unit the device is configured for. - Values should be mapped to "C" or "F" (case sensitive) - often the device will use a boolean or lower case for this - -- **min_temperature** (optional, number): a dp that reports the minimum temperature the water heater can be set to, in case this is not a fixed value. - -- **max_temperature** (optional, number): a dp that reports the maximum temperature the water heater can be set to, in case this is not a fixed value. - -- **away_mode** (optional, boolean): a dp to control whether the water heater is in away mode. - +# Device Configuration Files + +This directory contains device configuration files, describing the workings +of supported devices. The files are in YAML format, and describe the mapping +of Tuya DPs (Data Points) to HomeAssistant attributes. + +Each Tuya device may correspond to one primary entity and any number of +secondary entities in Home Assistant. + +## The Top Level + +The top level of the device configuration defines the following: + +### `name` + +The device should be named descriptively with a name the user would recognize, +the brand and model of the device is a good choice. If a whole family of +devices is supported, a generalization of the model type can be used. +The name should also indicate to the user what type of device it is. + +### `products` + +*Optional, for future use.* + +A list of products that this config applies to. Each product in the list must +have an `id` specified, which corresponds to the productId or productKey +(depending on where you are getting it from) in Tuya info. This is available +from the Tuya developer web portal listing for your device, or when using +UDP discovery (via tinytuya). In future it is intended that UDP discovery +will be used to more precisely match devices to configs, so it is recommended +to report these if you can find them when requesting a new device. Each +listing can also have an optional `name`, which is intended to override the +top level `name` when full support for this field is added. +Probably other info will be added in future to provide better reporting of +device manufacturer and model etc. + +### `primary_entity` + +This contains the configuration for one Home Assistant entity which is +considered the main entity for the device. For example, if the device is +a heater, this would be a climate entity. + +The configuration for entities is detailed in its own section below. + +### `secondary_entities` + +*Optional.* + +This contains a list of additional Home Assistant entities +providing additional functionality beyond the capabilities of the primary +entity. Examples include lighting control for display panels as a Home +Assistant light entity, child locks as a Home Assistant lock entity, +or additional toggles as Home Assistant switch entities. + +The configuration for secondary entities is the same as primary entities, +and is detailed in the section below. + +## Entity configuration + +### `entity` + +The Home Assistant entity type being configured. Currently supported +types are **climate**, **switch**, **light**, **lock**. Functionality +for these entities is limited to that which has been required for the +devices until now and may need to be extended for new devices. In +particular, the light and lock entities have only been used for simple +secondary entities, so only basic functionality is implemented. + +### `class` + +*Optional.* + +For some entity types, a device `class` can be set, for example `switch` +entities can have a class of `outlet`. This may slightly alter the UI +behaviour. +For most entities, it will alter the default icon, and for binary sensors +also the state that off and on values translate to in the UI. + +### `category` + +*Optional.* + +This specifies the `entity category` of the entity. Entities can be categorized +as `config` or `diagnostic` to restrict where they appear automatically in +Home Assistant. + +### `dps` + +This is a list of the definitions for the Tuya DPs associated with +attributes of this entity. There should be one list entry for each +supported DPs reported by the device. + +The configuration of DPs entries is detailed in its own section below. + +### `name` + +*Optional.* + +The name associated with this entity can be set here. If no name is set, +it will inherit the name at the top level. This is mostly useful for +overriding the name of secondary entities to give more information +about the purpose of the entity, as the generic type with the top level +name may not be sufficient to describe the function. + +### `mode` + +*Optional. For number entities, default="auto", for others, None* + +For number entities, this can be used to force `slider` or `box` as the +input method. The default `auto` uses a slider if the range is small enough, +or a box otherwise. + +## DPs configuration + +### `id` + +Every DP must have a numeric ID matching the DP ID in the Tuya protocol. + +### `type` + +The type of data returned by the Tuya API. Can be one of the following: + + - **string** can contain arbitrary text. + - **boolean** can contain the values **True** or **False**. + - **integer** can contain only numbers. Integers can have range set on them, be scaled and steped + - **bitfield** is a special case of integer, where the bits that make up the value each has individal meaning. + - **unixtime** is a special case of integer, where the device uses a unix timestamp (seconds since 1970-01-01 00:00), which is converted to a datetime for Home Assistant + - **base64** is a special case of string, where binary data is base64 encoded. Platforms that use this type will need special handling to make sense of the data. + - **hex** is a special case of string, where binary data is hex encoded. Platforms that use this type will need special handling to make sense of the data. + - **json** is a special case of string, where multiple data points are encoded in json format in the string. Platforms that use this type will need special handling to make sense of the data. + - **float** can contain floating point numbers. No known devices use this, but it is supported if needed. + +### `name` + +The name given to the attribute in Home Assistant. Certain names are used +by the Home Assistant entities for specific purposes. If a name is not +recognized as a standard attribute by the entitiy implementation, the +attribute will be returned as a readonly custom attribute on the entity. +If you need non-standard attributes to be able to be set, you will need +to use a secondary entity for that. + +### `readonly` + +*Optional, default false.* + +A boolean setting to mark attributes as readonly. If not specified, the +default is `false`. If set to `true`, the attributes will be reported +to Home Assistant, but attempting to set them will result in an error. +This is only needed in contexts where it would normally be possible to set +the value. If you are creating a sensor entity, or adding an attribute of an +entity which is inherently read-only, then you do not need to specify this. + +### `optional` + +*Optional, default false.* + +A boolean setting to mark attributes as optional. This allows a device to be +matched even if it is not sending the dp at the time when adding a new device. +It can also be used to match a range of devices that have variations in the extra +attributes that are sent. + +### `persist` + +*Optional, default true.* + +Whether to persist the value if the device does not return it on every status +refresh. Some devices don't return every value on every status poll. In most +cases, it is better to remember the previous value, but in some cases the +dp is used to signal an event, so when it is next sent, it should trigger +automations even if it is the same value as previously sent. In that case +the value needs to go to null in between when the device is not sending it. + +### `force` + +*Optional, default false.* + +A boolean setting to mark dps as requiring an explicit update request +to fetch. Many energy monitoring smartplugs require this, without a +explicit request to update them, such plugs will only return monitoring data +rarely or never. Devices can misbehave if this is used on dps that do not +require it. Use this only where needed, and generally only on read-only dps. + +### `precision` + +*Optional, default None.* + +For integer dps that are sensor values, the suggested precision for +display in Home Assistant can be specified. If unspecified, the Home +Assistant will use the native precision, which is calculated based on +the scale of the dp so as to provide distinct values with as few +decimal places as possible. For example a scale of 3 will result in +one decimal place by default, (values displayed as x.3, x.7 rather +than x.33333333 and x.666666) but you could override that to 2 or 0 +with by specifying the precision explicitly. + +### `mapping` + +*Optional. Must be a list with each item starting with a `- ` (a dash and a space):* +This can be used to define a list of additional rules that modify the DP +to Home Assistant attribute mapping to something other than a one to one +copy. + +The rules can range from simple value substitution to complex +relationships involving other attributes. It can also be used to change +the icon of the entity based on the attribute value. Mapping rules are +defined in their own section below. + +### `hidden` + +*Optional, default false.* +This can be used to define DPs that do not directly expose Home Assistant +attributes. When set to **true**, no attribute will be sent. A `name` should +still be specified and the attribute can be referenced as a `constraint` +from mapping rules on other attributes to implement complex mappings. + +An example of use is a climate device, where the Tuya device keeps separate +temperature settings for different Normal and Eco preset modes. The Normal +temperature setting is exposed through the standard `temperature` +Home Assistant attribute on the climate device, but the `eco_temperature` +setting on a different DP is set to hidden. Mapping Rules are used on the +`temperature` attribute to redirect to `eco_temperature` when `preset_mode` +is set to Eco. + +### `range` + +*Optional, may be required in some contexts, may have defaults in others.* + +For integer attributes that are not readonly, a range can be set with `min` +and `max` values that will limit the values that the user can enter in the +Home Assistant UI. This can also be set in a `mapping` or `conditions` block. + +### `unit` + +*Optional, default="C" for temperature dps on climate devices.* + +For temperature dps, some devices will use Fahrenhiet. This needs to be +indicated back to HomeAssistant by defining `unit` as "F". For sensor +entities, see the HomeAssistant developer documentation for the full list +of possible units (C and F are automatically translated to their Unicode +equivalents, other units are currently ASCII so can be easily entered directly). + +### `class` + +*Optional.* + +For sensors, this sets the state class of the sensor (measurement, total +or total_increasing) + + +### `format` + +*Optional.* + +For base64 and hex types, this specifies how to decode the binary data (after hex or base64 decoding). +This is a container field, the contents of which should be a list consisting of `name`, `bytes` and `range` fields. `range` is as described above. `bytes` is the number of bytes for the field, which can be `1`, `2`, or `4`. `name` is a name for the field, which will have special handling depending on +the device type. + +### `mask` + +*Optional.* + +For base64 and hex types, this specifies how to extract a single numeric value from the binary data. The value should be a hex bit mask (eg 00FF00 to extract the middle byte of a 3 byte value). Unlike format, this does not require special handling in the entity platform, as only a single value is being extracted. + +### `endianness` + +*Optional, default="big"* + +For base64 and hex types, this specifies the endianess of the data and mask. Could be "big" or "little". + +## Mapping Rules + +Mapping rules can change the behavior of attributes beyond simple +copying of DP values to attribute values. Rules can be defined +without a dps_val to apply to all values, or a list of rules that +apply to particular dp values can be defined to change only +particular cases. Rules can even depend on the values of other +elements. + +### `dps_val` + +*Optional, if not provided, the rule is a default that will apply to all +values not covered by their own dps_val rule.* + +`dps_val` defines the DP value that each +rule in the list applies to. This can be used to map specific values from the +Tuya protocol into attribute values that have specific meaning in Home +Assistant. For example, climate entities in Home Assistant define modes +"off", "heat", "cool", "heat_cool", "auto" and "dry". But in the Tuya protocol, +a simple heater just has a boolean off/on switch. It can also be used to +change the icon when a specific mode is operational. For example if +a heater device has a fan-only mode, you could change the icon to "mdi:fan" +instead of "mdi:radiator" when in that mode. +A `dps_val` of `null` can be used to specify a value to be assumed when a +dp is not being returned by the device, to avoid None in some locations where +that causes an issue such as entities showing as unavailable. Such a mapping +is one-way, the value will not be mapped back to a null when setting the dp. + +### `value` + +*Optional.* + +This can be used to set the attribute value seen by Home Assistant to something +different than the DP value from the Tuya protocol. Normally it will be used +with `dps_val` to map from one value to another. Without `dps_val` it will +one-way map all otherwise unmapped dps values to the specified value. This +can be useful for a binary_sensor. + +### `hidden` + +*Optional, default=false* + +When set to true, the mapping value is hidden from the list of all values. +This can be used for items that should not be available for selection by the +user but you still want to map for feedback coming from the device. For +example, some devices have a "Manual" mode, which is automatically selected +when adjustments are made to other settings, but should not be available as +an explicit mode for the user to select. + +### `scale` + +*Optional, default=1.* + +This can be used in an `integer` dp mapping to scale the values. For example +some climate devices represent the temperature as an integer in tenths of +degrees, and require a scale of 10 to convert them to degrees expected by +Home Assistant. The scale can also be the other way, for a fan with speeds +1, 2 and 3 as DP values, this can be converted to a percentage with a scale +of 0.03. + +### `invert` + +*Optional, default=False.* + +This can be used in an `integer` dp mapping to invert the range. For example, +some cover devices have an opposite idea of which end of the percentage scale open +and closed are from what Home Assistant assumes. To use this mapping option, a range +must also be specified for the dp. + +### `step` + +*Optional, default=1.* + +This can be used in an `integer` dp mapping to make values jump by a specific +step. It can also be set in a conditions block so that the steps change only +under certain conditions. An example is where a value has a range of 0-100, but +only allows settings that are divisible by 10, so a step of 10 would be set. + +### `target_range` + +*Optional, has `min` and `max` child attributes, like `range`* + +A target range is used together with `range` on a numeric value, to +map the value into a new range. Unlike `scale`, this can shift the +value as well as scale it into the new range. Color temperature is a +major use of this, as Tuya devices often use a range of 0 - 100, 0 - +255 or 0 - 1000, and this needs to be mapped to the Kelvin like 2200 - +6500. + +This should normally only be used on a default mapping, as the code +that uses this feature often needs to inform HA of the min and max +values for the UI, which may not handle multipe different mappings +across the range. + +### `icon` + +*Optional.* + +This can be used to override the icon. Most useful with a `dps_val` which +indicates a change from normal operating mode, such as "fan-only", +"defrosting", "tank-full" or some error state. + +### `icon_priority` + +*Optional. Default 10. Lower numbers mean higher priorities.* + +When a number of rules on different attributes define `icon` changes, you +may need to control which have priority over the others. For example, +if the device is off, probably it is more important to indicate that than +whether it is in fan-only or heat mode. So in the off/on DP, you might +give a priority of 1 to the off icon, 3 to the on icon, and in the mode DP +you could give a priority of 2 to the fan icon, to make it override the +normal on icon, but not the off icon. +If you don't specify any priorities, the icons will all get the same priority, +so if any overlap exists in the rules, it won't always be predictable which +icon will be displayed. + +### `value_redirect` + +*Optional.* + +When `value_redirect` is set, the value of the attribute and any attempt to +set it will be redirected to the named attribute instead of the current one. + +An example of how this can be useful is where a Tuya heater has a dp for the +target temperature in normal mode, and a different dp for the target +temperature is "eco" mode. Depending on the `preset_mode`, you need to use +one or the other. But Home Assistant just has one `temperature` attribute for +setting target temperature, so the mapping needs to be done before passing to +Home Assistant. + +### `value_mirror` + +*Optional.* + +When `value_mirror` is set, the value of the attribute will be redirected to +the current value of the named attribute. Unlike `value_redirect`, this does +not redirect attempts to set the dp to the redirected dp, but when used in +a map, this can make the mapping dynamic. + +An example of how this can be useful is where a thermostat can be configured +to control either a heating or cooling device, but it is not expected to +change this setting during operation. Once set up, the hvac_mode dp can +have a mapping that mirrors the value of the configuration dp. + +### `invalid` + +*Optional, default false.* + +Invalid set to true allows an attribute to temporarily be set read-only in +some conditions. Rather than passing requests to set the attribute through +to the Tuya protocol, attempts to set it will throw an error while it meets +the conditions to be `invalid`. It does not make sense to set this at mapping +level, as it would cause a situation where you can set a value then not be +able to unset it. Instead, this should be used with conditions, below, to +make the behaviour dependent on another DP, such as disabling fan speed +control when the preset is in sleep mode (since sleep mode should force low). + +### `default` + +*Optional, default false.* + +Default set to true allows an attribute to be set as the default value. +This is used by some entities when an argument is not provided to a service call +but the attribute is required to be set to function correctly. +An example is the siren entity which uses the tone attribute to turn on and +off the siren, but when turn_on is called without any argument, it needs to +pick a default tone to use to turn on the siren. + +### `constraint` + +*Optional, always paired with `conditions`. Default if unspecified is the current attribute* + +If a rule depends on an attribute other than the current one, then `constraint` +can be used to specify the element that `conditions` applies to. `constraint` can also refer back to the same attribute - this can be useful for specifying conditional mappings, for example to support two different variants of a device in a single config file, where the only difference is the way they represent enum attributes. + +### `conditions` + +*Optional, usually paired with `constraint.`* + +Conditions defines a list of rules that are applied based on the `constraint` attribute. The contents are the same as Mapping Rules, but `dps_val` applies to the attribute specified by `constraint`, and also can be a list of values to match as well rather than a single value. All others act on the current attribute as they would in the mapping. Although conditions are specified within a mapping, they can also contain a `mapping` of their own to override that mapping. These nested mappings are limited to simple `dps_val` to `value` substitutions, as more complex rules would quickly become too complex to manage. + +When setting a dp which has conditions attached, the behaviour is slightly different depending on whether the constraint dp is readonly or not. + +For non-readonly constraints that specify a single dps_val, the constraint dp will be set along with the target dp so that the first condition with a value matching the target value is met. + +For readonly constraints, the condition must match the constraint dp's current value for anything to be set. + +**Example** +```yaml + ... + name: target_dp + mapping: + - dps_val: 1 + constraint: constraint_dp + conditions: + - dps_val: a + value: x + - dpa_val: c + value: z + - dps_val: 2 + constraint: constraint_dp + conditions: + - dps_val: b + value: x + - dps_val: c + value: y +``` +If `constraint_dp` is not readonly: + +| constraint_dp current dps_val | target_dp target value | dps set | +|---|---|---| +| a | x | target_dp: 1, constraint_dp: a | +| a | y | target_dp: 2, constraint_dp: c | +| a | z | target_dp: 1, constraint_dp: c | +| b | x | target_dp: 1, constraint_dp: a | +| b | y | target_dp: 2, constraint_dp: c | +| b | z | target_dp: 1, constraint_dp: c | +| c | x | target_dp: 1, constraint_dp: a | +| c | y | target_dp: 2, constraint_dp: c | +| c | z | target_dp: 1, constraint_dp: c | + +If `constraint_dp` is readonly: + +| current constraint_dp | target target_dp | dps set | +|---|---|---| +| a | x | target_dp: 1 | +| a | y | - | +| a | z | - | +| b | x | target_dp: 2 | +| b | y | - | +| b | z | - | +| c | x | - | +| c | y | target_dp: 2 | +| c | z | target_dp: 1 | + + + +## Entity types + +Entities have specific mappings of dp names to functions. Any unrecognized dp name is added +to the entity as a read-only extra attribute, so can be observed and queried from HA, but if you need +to be able to change it, you should split it into its own entity of an appropriate type (number, select, switch for example). + +If the type of dp does not match the expected type, a mapping should be provided to convert. +Note that "on" and "off" require quotes in yaml, otherwise it they are interpretted as true/false. + +Many entity types support a class attribute which may change the UI behaviour, icons etc. See the +HA documentation for the entity type to see what is valid (these may expand over time) + +### `alarm_control_panel` +- **alarm_state** (required, string) the alarm state, used to report and change the current state of the alarm. Expects values from the set `disarmed`, `armed_home`, `armed_away`, `armed_night`, `armed_vacation`, `armed_custom_bypass`, `pending`, `arming`, `disarming`, `triggered`. Other states are allowed for read-only status, but only the armed... and disarmed states are available as commands. +- **trigger** (optional, boolean) used to trigger the alarm remotely for test or panic button etc. + +### `binary_sensor` +- **sensor** (required, boolean) the dp to attach to the sensor. + +### `button` +- **button** (required, boolean) the dp to attach to the button. Any +read value will be ignored, but the dp is expected to be present for +device detection unless set to optional. A value of true will be sent +for a button press, map this to the desired dps_val if a different +value is required. + +### `climate` +- **aux_heat** (optional, boolean, DEPRECATED) a dp to control the aux heat switch if the device has one. Note this is being deprecated by HA and no longer accessible from the UI since HA 2023.9, though the deprecation announcement is yet to be made as of 2023.11. It is recommended not to use this, and instead use an separate switch entity. +- **current_temperature** (optional, number) a dp that reports the current temperature. +- **current_humidity** (optional, number) a dp that reports the current humidity (%). +- **fan_mode** (optional, mapping of strings) a dp to control the fan mode if available. + Any value is allowed, but HA has some standard modes: + `"on", "off", auto, low, medium, high, top, middle, focus, diffuse` +- **humidity** (optional, number) a dp to control the target humidity if available. (%) +- **hvac_mode** (optional, mapping of strings) a dp to control the mode of the device. + Possible values are: `"off", cool, heat, heat_cool, auto, dry, fan_only` +- **hvac_action** (optional, string) a dp thar reports the current action of the device. + Possible values are: `"off", idle, cooling, heating, drying, fan` +- **preset_mode** (optional, mapping of strings) a dp to control preset modes of the device. + Any value is allowed, but HA has some standard presets: + `none, eco, away, boost, comfort, home, sleep, activity` +- **swing_mode** (optional, mapping of strings) a dp to control swing modes of the device. + Possible values are: `"off", vertical, horizontal` +- **temperature** (optional, number) a dp to set the target temperature of the device. + A unit may be specified as part of the attribute if a temperature_unit dp is not available, if not + the default unit configured in HA will be used. +- **target_temp_high** (optional, number) a dp to set the upper temperature range of the device. + This dp should be paired with `target_temp_low`, and is mutually exclusive with `temperature` +- **target_temp_low** (optional, number) a dp to set the lower temperature range of the device. +- **temperature_unit** (optional, string) a dp that specifies the unit the device is configured for. + Values should be mapped to "C" or "F" (case sensitive) - often the device will use a boolean or + lower case for this +- **min_temperature** (optional, number) a dp that specifies the minimum temperature that can be set. Some devices provide this, otherwise a fixed range on the temperature dp can be used. +- **max_temperature** (optional, number) a dp that specifies the maximum temperature that can be set. + +### `cover` + +Either **position** or **open** should be specified. + +- **position** (optional, number 0-100): a dp to control the percentage that the cover is open. + 0 means completely close, 100 means completely open. +- **control** (optional, mapping of strings): a dp to control the cover. Mainly useful if **position** cannot be used. + Valid values are `open, close, stop` +- **action** (optional, string): a dp that reports the current state of the cover. + Special values are `opening, closing` +- **open** (optional, boolean): a dp that reports if the cover is open. Only used if **position** is not available. + +### `fan` +- **switch** (optional, boolean): a dp to control the power state of the fan +- **preset_mode** (optional, mapping of strings): a dp to control different modes of the fan. + Values `"off", low, medium, high` used to be handled specially by HA as deprecated speed aliases. If these are the only "presets", consider mapping them as **speed** values instead, as voice assistants will respond to phrases like "turn the fan up/down" for speed. +- **speed** (optional, number 0-100): a dp to control the speed of the fan (%). + scale and step can be used to convert smaller ranges to percentages, or a mapping for discrete values. +- **oscillate** (optional, boolean): a dp to control whether the fan will oscillate or not. +- **direction** (optional, string): a dp to control the spin direction of the fan. + Valid values are `forward, reverse`. + +### `humidifier` +Humidifer can also cover dehumidifiers (use class to specify which). + +- **switch** (optional, boolean): a dp to control the power state of the fan +- **mode** (optional, mapping of strings): a dp to control preset modes of the device +- **humidity** (optional, number): a dp to control the target humidity of the device +- **current_humidity** (optional, number): a dp to report the current humidity measured by the device + +### `light` +- **switch** (optional, boolean): a dp to control the on/off state of the light +- **brightness** (optional, number 0-255): a dp to control the dimmer if available. +- **color_temp** (optional, number): a dp to control the color temperature if available. See `target_range` above for mapping Tuya's range into Kelvin. + +- **rgbhsv** (optional, hex): a dp to control the color of the light, using encoded RGB and HSV values. The `format` field names recognized for decoding this field are `r`, `g`, `b`, `h`, `s`, `v`. +- **color_mode** (optional, mapping of strings): a dp to control which mode to use if the light supports multiple modes. + Special values: `white, color_temp, hs, xy, rgb, rgbw, rgbww`, others will be treated as effects, + Note: only white, color_temp and hs are currently supported, others listed above are reserved and may be implemented in future when the need arises. + If no `color_mode` dp is available, a single supported color mode will be + calculated based on which of the above dps are available. +- **effect** (optional, mapping of strings): a dp to control effects / presets supported by the light. + Note: If the light mixes in color modes in the same dp, `color_mode` should be used instead. If the light contains both a separate dp for effects/scenes/presets and a mix of color_modes and effects (commonly scene and music) in the `color_mode` dp, then a separate select entity should be used for the dedicated dp to ensure the effects from `color_mode` are selectable. + +### `lock` + +The unlock... dps below are normally integers, but can also be boolean, in which case +no information will be available about which specific credential was used to unlock the lock. + +- **lock** (optional, boolean): a dp to control the lock state: true = locked, false = unlocked +- **unlock_fingerprint** (optional, integer): a dp to identify the fingerprint used to unlock the lock. +- **unlock_password** (optional, integer): a dp to identify the password used to unlock the lock. +- **unlock_temp_pwd** (optional, integer): a dp to identify the temporary password used to unlock the lock. +- **unlock_dynamic_pwd** (optional, integer): a dp to identify the dynamic password used to unlock the lock. +- **unlock_offline_pwd** (optional, integer): a dp to identify the offline password used to unlock the lock. +- **unlock_card** (optional, integer): a dp to identify the card used to unlock the lock. +- **unlock_app** (optional, integer): a dp to identify the app used to unlock the lock. +- **unlock_key** (optional, integer): a dp to identify the key used to unlock the lock. +- **unlock_ble** (optional, integer): a dp to identify the BLE device used to unlock the lock. +- **unlock_voice** (optional, integer): a dp to identify the voice assistant user used to unlock the lock. +- **request_unlock** (optional, integer): a dp to signal that a request has been made to unlock, the value should indicate the time remaining for approval. +- **approve_unlock** (optional, boolean): a dp to unlock the lock in response to a request. +- **request_intercom** (optional, integer): a dp to signal that a request has been made via intercom to unlock, the value should indicate the time remaining for approval. +- **approve_intercom** (optional, boolean): a dp to unlock the lock in response to an intercom request. +- **jammed** (optional, boolean): a dp to signal that the lock is jammed. + +### `number` +- **value** (required, number): a dp to control the number that is set. +- **unit** (optional, string): a dp that reports the units returned by the number. + This may be useful for devices that switch between C and F, otherwise a fixed unit attribute on the **value** dp can be used. +- **minimum** (optional, number): a dp that reports the minimum the number can be set to. + This may be used as an alternative to a range setting on the **value** dp if the range is dynamic +- **maximum** (optional, number): a dp that reports the maximum the number can be set to. + This may be used as an alternative to a range setting on the **value** dp if the range is dynamic + +### `select` +- **option** (required, mapping of strings): a dp to control the option that is selected. + +### `sensor` +- **sensor** (required, number or string): a dp that returns the current value of the sensor. +- **unit** (optional, string): a dp that returns the unit returned by the sensor. + This may be useful for devices that switch between C and F, otherwise a fixed unit attribute on the **sensor** dp can be used. + +### `siren` +- **tone** (required, mapping of strings): a dp to report and control the siren tone. As this is used to turn on and off the siren, it is required. If this does not fit your siren, the underlying implementation will need to be modified. +The value "off" will be used for turning off the siren, and will be filtered from the list of available tones. One value must be marked as `default: true` so that the `turn_on` service with no commands works. +- **volume** (optional, float in range 0.0-1.0): a dp to control the volume of the siren (probably needs a scale and step applied, since Tuya devices will probably use an integer, or strings with fixed values). +- **duration** (optional, integer): a dp to control how long the siren will sound for. + +### `switch` +- **switch** (required, boolean): a dp to control the switch state. + +### `vacuum` +- **status** (required, mapping of strings): a dp to report and control the status of the vacuum. +- **command** (optional, mapping of strings): a dp to control the statuss of the vacuum. If supplied, the status dp is only used to report the state. + Special values: `return_to_base, clean_spot`, others are sent as general commands +- **locate** (optional, boolean): a dp to trigger a locator beep on the vacuum. +- **power** (optional, boolean): a dp to switch full system power on and off +- **activate** (optional, boolean): a dp to start and pause the vacuum +- **direction_control** (optional, mapping of strings): a dp that is used for directional commands + These are additional commands that are not part of **status**. They can be sent as general commands from HA. +- **error** (optional, bitfield): a dp that reports error status. + As this is mapped to a single "fault" state, you could consider separate binary_sensors to report on individual errors + +### `water_heater` +- **current_temperature** (optional, number): a dp that reports the current water temperature. + +- **operation_mode** (optional, mapping of strings): a dp to report and control the operation mode of the water heater. If `away` is one of the modes, another mode must be marked as `default: true` to that the `away_mode_off` service knows which mode to switch out of away mode to. + +- **temperature** (optional, number): a dp to control the target water temperature of the water heater. A unit may be specified as an attribute if the `temperature_unit` dp is not available, otherwise the default of HA's current setting will be used. + +- **temperature_unit** (optional, string): a dp that reports the unit the device is configured for. + Values should be mapped to "C" or "F" (case sensitive) - often the device will use a boolean or lower case for this + +- **min_temperature** (optional, number): a dp that reports the minimum temperature the water heater can be set to, in case this is not a fixed value. + +- **max_temperature** (optional, number): a dp that reports the maximum temperature the water heater can be set to, in case this is not a fixed value. + +- **away_mode** (optional, boolean): a dp to control whether the water heater is in away mode. + diff --git a/custom_components/tuya_local/devices/akai_dryer.yaml b/custom_components/tuya_local/devices/akai_dryer.yaml new file mode 100644 index 00000000..918bd1d3 --- /dev/null +++ b/custom_components/tuya_local/devices/akai_dryer.yaml @@ -0,0 +1,133 @@ +name: Dryer +products: + - id: do3cbzmmdqfdpqxw + name: Akai heat pump dryer +primary_entity: + entity: sensor + class: enum + icon: "mdi:tumble-dryer" + dps: + - id: 107 + name: sensor # state + type: string + mapping: + - dps_val: "off" + value: "off" + - dps_val: "set" + value: "set" + - dps_val: "run" + value: "run" + - dps_val: "pause" + value: "pause" + - dps_val: "delay" + value: "delay" + - dps_val: "end" + value: "end" + - dps_val: "err" + value: "error" + - id: 7 + name: fault_code + type: integer +secondary_entities: + - entity: button + name: Start + icon: "mdi:play" + dps: + - id: 105 + name: button # start + type: boolean + - entity: button + name: Pause + icon: "mdi:pause" + dps: + - id: 105 + name: button # start + type: boolean + mapping: + - dps_val: false + value: true + - entity: select + name: Drying mode + icon: "mdi:tumble-dryer" + dps: + - id: 5 + name: option # drying_mode + type: string + mapping: + - dps_val: "OFF" + value: "Off" + - dps_val: "Standard" + value: "Standard" + - dps_val: "Cotton" + value: "Cotton" + - dps_val: "Synthetic" + value: "Synthetic" + - dps_val: "Bulky_Ttem" + value: "Bulky Item" + - dps_val: "Towel" + value: "Towel" + - dps_val: "Wool" + value: "Wool" + - dps_val: "Duvet" + value: "Duvet" + - dps_val: "Baby_Care" + value: "Baby Care" + - dps_val: "Warm_Air" + value: "Warm Air" + - dps_val: "Refresh" + value: "Refresh" + - dps_val: "Time" + value: "Time" + - dps_val: "Underwear" + value: "Underwear" + - dps_val: "Denim" + value: "Denim" + - dps_val: "Shirts" + value: "Shirts" + - dps_val: "Sportswear" + value: "Sportswear" + - entity: select + name: Drying level + icon: "mdi:signal" + dps: + - id: 101 + name: option # drying_level + type: integer + mapping: + - dps_val: 0 + value: "Auto" + - dps_val: 1 + value: "Low" + - dps_val: 2 + value: "Medium" + - dps_val: 3 + value: "High" + - entity: switch + name: Anti crease + icon: "mdi:iron" + dps: + - id: 103 + name: switch + type: boolean + - entity: lock + name: Lock + dps: + - id: 106 + name: lock + type: boolean + - entity: sensor + name: Drying time + class: duration + dps: + - id: 3 + name: sensor + type: integer + unit: min + - entity: sensor + name: Drying time remaining + class: duration + dps: + - id: 4 + name: sensor # drying_time_left + type: integer + unit: min diff --git a/custom_components/tuya_local/devices/alecoair_d12_dehumidifier.yaml b/custom_components/tuya_local/devices/alecoair_d12_dehumidifier.yaml index 2aaae323..977df13a 100644 --- a/custom_components/tuya_local/devices/alecoair_d12_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/alecoair_d12_dehumidifier.yaml @@ -12,7 +12,7 @@ primary_entity: mapping: - dps_val: false icon: "mdi:air-humidifier-off" - icon_priority: 1 + icon_priority: 2 - dps_val: true icon: "mdi:air-humidifier" icon_priority: 4 @@ -46,19 +46,18 @@ primary_entity: - id: 19 name: error type: bitfield - # Docs mention E1 and E2, it isn't clear which is tank full, so for now - # treat both as that. + # E2 might be a compressor fault. mapping: - dps_val: 0 value: OK - dps_val: 1 - value: E1 + value: "Water Tank Full or Removed" icon: "mdi:cup-water" - icon_priority: 2 + icon_priority: 1 - dps_val: 2 - value: E2 - icon: "mdi:cup-water" - icon_priority: 2 + value: "E2 Compressor Fault" + icon: "mdi:engine-off-outline" + icon_priority: 1 secondary_entities: - entity: fan dps: @@ -117,9 +116,20 @@ secondary_entities: - dps_val: true icon: "mdi:hand-back-right-off" - entity: binary_sensor - name: Tank class: problem - category: diagnostic + name: Tank full + icon: "mdi:cup-water" + dps: + - id: 19 + type: bitfield + name: sensor + mapping: + - dps_val: 1 + value: true + - value: false + - entity: binary_sensor + class: problem + name: Fault dps: - id: 19 type: bitfield @@ -127,4 +137,8 @@ secondary_entities: mapping: - dps_val: 0 value: false + - dps_val: 1 + value: false + - dps_val: null + value: false - value: true diff --git a/custom_components/tuya_local/devices/alecoair_d16_dehumidifier.yaml b/custom_components/tuya_local/devices/alecoair_d16_dehumidifier.yaml index 26e37910..865e73a5 100644 --- a/custom_components/tuya_local/devices/alecoair_d16_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/alecoair_d16_dehumidifier.yaml @@ -12,7 +12,7 @@ primary_entity: mapping: - dps_val: false icon: "mdi:air-humidifier-off" - icon_priority: 1 + icon_priority: 2 - dps_val: true icon: "mdi:air-humidifier" icon_priority: 4 @@ -48,19 +48,18 @@ primary_entity: - id: 19 name: error type: bitfield - # Docs mention E1 and E2, it isn't clear which is tank full, so for now - # treat both as that. + # E2 might be a compressor fault. mapping: - dps_val: 0 value: OK - dps_val: 1 - value: E1 + value: "Water Tank Full or Removed" icon: "mdi:cup-water" - icon_priority: 2 + icon_priority: 1 - dps_val: 2 - value: E2 - icon: "mdi:cup-water" - icon_priority: 2 + value: "E2 Compressor Fault" + icon: "mdi:engine-off-outline" + icon_priority: 1 secondary_entities: - entity: fan dps: @@ -108,9 +107,20 @@ secondary_entities: unit: "%" class: measurement - entity: binary_sensor - name: Tank class: problem - category: diagnostic + name: Tank full + icon: "mdi:cup-water" + dps: + - id: 19 + type: bitfield + name: sensor + mapping: + - dps_val: 1 + value: true + - value: false + - entity: binary_sensor + class: problem + name: Fault dps: - id: 19 type: bitfield @@ -118,6 +128,10 @@ secondary_entities: mapping: - dps_val: 0 value: false + - dps_val: 1 + value: false + - dps_val: null + value: false - value: true - entity: lock name: Child lock diff --git a/custom_components/tuya_local/devices/aquatech_x6_water_heater.yaml b/custom_components/tuya_local/devices/aquatech_x6_water_heater.yaml index f8bbc2bf..f919ac49 100644 --- a/custom_components/tuya_local/devices/aquatech_x6_water_heater.yaml +++ b/custom_components/tuya_local/devices/aquatech_x6_water_heater.yaml @@ -13,19 +13,14 @@ primary_entity: conditions: - dps_val: ECO value: eco - icon: "mdi:cash" - dps_val: Stand value: heat_pump - icon: "mdi:heat-pump" - dps_val: HYB value: high_demand - icon: "mdi:sun-thermometer" - dps_val: HYB1 value: performance - icon: "mdi:radiator" - dps_val: ELE value: electric - icon: "mdi:heating-coil" - id: 2 type: string name: work_mode @@ -37,22 +32,15 @@ primary_entity: min: 15 max: 75 readonly: true - icon: "mdi:thermometer-lines" - id: 7 type: boolean name: defrosting - mapping: - - dps_val: true - icon: "mdi:snowflake-melt" - - dps_val: false - icon: "mdi:checkbox-blank-off-outline" - id: 15 type: bitfield name: fault_code - id: 16 type: integer name: current_temperature - icon: "mdi:thermometer-water" secondary_entities: - entity: binary_sensor class: problem diff --git a/custom_components/tuya_local/devices/arlec_pb88uha_s2_switch.yaml b/custom_components/tuya_local/devices/arlec_pb88uha_s2_switch.yaml index a25abc26..02202179 100644 --- a/custom_components/tuya_local/devices/arlec_pb88uha_s2_switch.yaml +++ b/custom_components/tuya_local/devices/arlec_pb88uha_s2_switch.yaml @@ -1,4 +1,7 @@ -name: Arlec PB88UHA Series 2 Powerboard +name: Quad powerboard +products: + - id: vcbjjhz6pwwwkyek + name: Arlec PB88UHA Series 2 primary_entity: entity: switch name: Outlet 1 diff --git a/custom_components/tuya_local/devices/beok_tgm50_thermostat.yaml b/custom_components/tuya_local/devices/beok_tgm50_thermostat.yaml new file mode 100644 index 00000000..b6491c54 --- /dev/null +++ b/custom_components/tuya_local/devices/beok_tgm50_thermostat.yaml @@ -0,0 +1,234 @@ +name: Thermostat +products: + - id: m3j5wouhgsvjlma9 + name: Beok TGM50-WIFI-WP +primary_entity: + entity: climate + translation_key: thermostat + dps: + - id: 1 + name: hvac_mode + type: boolean + mapping: + - dps_val: true + constraint: preset_mode + conditions: + - dps_val: auto + value: auto + - dps_val: temporary + value: auto + hidden: true + - dps_val: home + value: heat + - value: heat + hidden: true + - dps_val: false + value: "off" + - id: 2 + name: temperature + type: integer + range: + min: 50 + max: 300 + mapping: + - scale: 10 + step: 5 + - id: 3 + type: integer + name: current_temperature + mapping: + - scale: 10 + - id: 4 + type: string + name: preset_mode + mapping: + - dps_val: leave + value: away + - dps_val: home + value: manual + - dps_val: auto + value: program + - dps_val: temporary + value: temp_override + - id: 5 + type: string + name: hvac_action + mapping: + - dps_val: "0" + constraint: hvac_mode + conditions: + - dps_val: true + value: idle + icon: "mdi:radiator-disabled" + - dps_val: false + value: "off" + icon: "mdi:radiator-off" + - dps_val: "1" + value: heating + icon: "mdi:radiator" + - id: 11 + name: fault_code + type: bitfield + - id: 15 + name: max_temperature + type: integer +secondary_entities: + - entity: lock + name: Child lock + category: config + dps: + - id: 9 + type: boolean + name: lock + mapping: + - dps_val: true + icon: "mdi:hand-back-right-off" + - dps_val: false + icon: "mdi:hand-back-right" + - entity: binary_sensor + name: Fault + category: diagnostic + class: problem + dps: + - id: 11 + type: bitfield + name: sensor + mapping: + - dps_val: 0 + value: false + - value: true + - entity: number + name: Temperature hysteresis + category: config + icon: "mdi:thermometer-plus" + dps: + - id: 101 + type: integer + name: value + unit: ° + range: + min: 5 + max: 95 + mapping: + - scale: 10 + - entity: number + name: Maximum temperature + category: config + class: temperature + icon: "mdi:thermometer-chevron-up" + dps: + - id: 15 + type: integer + name: value + unit: C + range: + min: 15 + max: 95 + - entity: number + name: Calibration offset + category: config + icon: "mdi:arrow-collapse-up" + dps: + - id: 19 + type: integer + name: value + unit: ° + range: + min: -90 + max: 90 + mapping: + - scale: 10 + - entity: number + name: External temperature limit + category: config + class: temperature + icon: "mdi:arrow-collapse-up" + dps: + - id: 102 + type: integer + name: value + unit: C + range: + min: 5 + max: 60 + - entity: switch + name: Anti-frost + category: config + icon: "mdi:snowflake-melt" + dps: + - id: 103 + type: boolean + name: switch + - entity: button + name: Factory reset + class: restart + dps: + - id: 104 + name: button + type: boolean + - entity: light + name: Backlight + category: config + dps: + - id: 106 + type: string + name: brightness + mapping: + - dps_val: "0" + icon: "mdi:lightbulb-on-10" + value: 0 + - dps_val: "1" + icon: "mdi:lightbulb-on-40" + value: 100 + - dps_val: "2" + icon: "mdi:lightbulb-on-70" + value: 180 + - dps_val: "3" + icon: "mdi:lightbulb-on" + value: 255 + - entity: select + name: Schedule + category: config + icon: "mdi:calendar-clock" + dps: + - id: 107 + type: string + name: option + mapping: + - dps_val: "1" + value: "Weekday+Weekend" + - dps_val: "2" + value: "Mon-Sat+Sun" + - dps_val: "3" + value: "Daily" + - entity: switch + name: Invert output + category: config + icon: "mdi:swap-horizontal" + dps: + - id: 108 + type: boolean + name: switch + - entity: select + name: Sensor selection + category: config + icon: "mdi:home-thermometer" + dps: + - id: 110 + type: string + name: option + mapping: + - dps_val: "1" + value: Internal + - dps_val: "2" + value: External + - dps_val: "3" + value: Both + - entity: switch + name: Sound + category: config + icon: "mdi:music-note" + dps: + - id: 109 + type: boolean + name: switch diff --git a/custom_components/tuya_local/devices/blitzwolf_bw_lt31.yaml b/custom_components/tuya_local/devices/blitzwolf_bw_lt31.yaml new file mode 100644 index 00000000..42734ab7 --- /dev/null +++ b/custom_components/tuya_local/devices/blitzwolf_bw_lt31.yaml @@ -0,0 +1,177 @@ +name: LED strip +products: + - id: khu3zzkkjemj6oat + name: Blitzwolf BW-LT31 +primary_entity: + entity: light + icon: "mdi:led-strip-variant" + dps: + - id: 20 + type: boolean + name: switch + - id: 21 + type: string + name: color_mode + mapping: + - dps_val: dynamic_mod + value: Dynamic + - dps_val: color + value: hs + - dps_val: scene_mod + value: Scene + - dps_val: music + value: Music + - id: 22 + name: brightness + type: integer + optional: true + range: + min: 10 + max: 1000 + mapping: + - scale: 3.92 + - id: 24 + name: rgbhsv + type: hex + optional: true + format: + - name: h + bytes: 2 + range: + min: 0 + max: 360 + - name: s + bytes: 2 + range: + min: 0 + max: 1000 + - name: v + bytes: 2 + range: + min: 0 + max: 1000 + - id: 103 + name: line_sequence_adjustment + type: integer + - id: 104 + name: strip_points + type: integer +secondary_entities: + - entity: select + name: Music + icon: "mdi:palette" + category: config + dps: + - id: 102 + type: hex + name: option + optional: true + mapping: + - dps_val: 119 + value: "Classic 25%" + - dps_val: 132 + value: "Classic 50%" + - dps_val: 14b + value: "Classic 75%" + - dps_val: 164 + value: "Classic 100%" + - dps_val: 219 + value: "Soft 25%" + - dps_val: 232 + value: "Soft 50%" + - dps_val: 24b + value: "Soft 75%" + - dps_val: 264 + value: "Soft 100%" + - dps_val: 319 + value: "Dynamic 25%" + - dps_val: 332 + value: "Dynamic 50%" + - dps_val: 34b + value: "Dynamic 75%" + - dps_val: 364 + value: "Dynamic 100%" + - dps_val: 419 + value: "Disco 25%" + - dps_val: 432 + value: "Disco 50%" + - dps_val: 44b + value: "Disco 75%" + - dps_val: 464 + value: "Disco 100%" + - entity: select + name: Dynamic + icon: "mdi:palette" + category: config + dps: + - id: 106 + type: string + name: option + optional: true + mapping: + - dps_val: "013264000003e803e8" + value: "Breath" + # color+ R, speed 50, bright 100 + - dps_val: "023264000003e803e8" + value: "Flash" + # color+ R, speed 50, bright 100 + - dps_val: "033264000003e803e8007803e803e800f003e803e8003b03e803e8013603e803e8010e03e803e8" + value: "Jump" + # color+ R+G+B+Y+C+P, speed 50, bright 100 + - dps_val: "043264000003e803e8007803e803e800f003e803e8" + value: "Gradient" + # color+ R+G+B, speed 50, bright 100 + - dps_val: "053264" + value: "Symphony" + # color All, speed 50, bright 100 + - dps_val: "063264000003e803e8" + value: "Chasing" + # color1 R, speed 50, bright 100 + - dps_val: "073264000003e803e8" + value: "Meteor" + # color1 R, speed 50, bright 100 + - dps_val: "083264000003e803e8" + value: "Stacking" + # color1 R, speed 50, bright 100 + - dps_val: "0932640000000003e8" + value: "Adjoint" + # color1 W, speed 50, bright 100 + - entity: select + name: Scene + icon: "mdi:palette" + category: config + dps: + - id: 108 + type: string + name: option + optional: true + mapping: + - dps_val: "CJ_YD" + value: "Reading" + # color: white, static + - dps_val: "CJ_QC" + value: "Get Up" + # color: white, yellow, static + - dps_val: "CJ_WA" + value: "Good Night" + # color: red, static + - dps_val: "CJ_XK" + value: "Starry" + # color: blue, flash + - dps_val: "CJ_JH" + value: "Party" + # color* All, Flash, Mid speed + - dps_val: "CJ_YS" + value: "Film" + # color: lightblue, static + - entity: number + name: Strip points + category: config + dps: + - id: 104 + name: value + type: integer + optional: true + range: + min: 10 + max: 200 diff --git a/custom_components/tuya_local/devices/blitzwolf_bwsh5_humidifier.yaml b/custom_components/tuya_local/devices/blitzwolf_bwsh5_humidifier.yaml index 916788fa..cac96024 100644 --- a/custom_components/tuya_local/devices/blitzwolf_bwsh5_humidifier.yaml +++ b/custom_components/tuya_local/devices/blitzwolf_bwsh5_humidifier.yaml @@ -1,7 +1,7 @@ -# sample DPS {'1': True, '4': 'health', '5': True, '10': 24, '12': 75, '13': 55, '14': 77, '18': 'c', '19': 'cancel', '20': 0, '21': True, '22': 0, '23': 'level_1', '26': True, '35': True} -name: BlitzWolf BWSH5 humidifier +name: Humidifier products: - id: lqzme7o0kzhumdxr + name: BlitzWolf BWSH5 primary_entity: entity: humidifier class: humidifier @@ -40,13 +40,9 @@ primary_entity: name: current_humidity type: integer - id: 22 - name: unknown_22 + name: fault_code type: integer optional: true - - id: 23 - name: unknown_23 - type: string - optional: true secondary_entities: - entity: switch name: UV sterilization @@ -56,6 +52,7 @@ secondary_entities: - id: 21 name: switch type: boolean + #optional: true - entity: switch name: Warm mist icon: "mdi:fire" @@ -64,6 +61,7 @@ secondary_entities: - id: 26 name: switch type: boolean + optional: true - entity: switch name: Plasma icon: "mdi:dots-circle" @@ -71,7 +69,8 @@ secondary_entities: dps: - id: 35 name: switch - type: boolean + type: boolean + optional: true - entity: light name: LED category: config @@ -84,17 +83,33 @@ secondary_entities: icon: "mdi:led-on" - dps_val: false icon: "mdi:led-off" - - entity: sensor - deprecated: humidifier - name: Current humidity - class: humidity - category: diagnostic + - entity: fan + name: Spray level + icon: "mdi:heat-wave" + category: config dps: - - id: 14 - type: integer - name: sensor - class: measurement - unit: "%" + - id: 1 + name: switch + type: boolean + - id: 23 + name: speed + type: string + optional: true + mapping: + - dps_val: "level_1" + value: 15 + - dps_val: "level_2" + value: 30 + - dps_val: "level_3" + value: 45 + - dps_val: "level_4" + value: 55 + - dps_val: "level_5" + value: 70 + - dps_val: "level_6" + value: 85 + - dps_val: "level_7" + value: 100 - entity: sensor class: temperature dps: @@ -107,6 +122,7 @@ secondary_entities: name: temperature_f type: integer unit: F + optional: true - entity: select name: Timer icon: "mdi:timer" @@ -115,6 +131,7 @@ secondary_entities: - id: 19 name: option type: string + optional: true mapping: - dps_val: "cancel" value: "Off" @@ -154,6 +171,7 @@ secondary_entities: - id: 18 type: string name: option + optional: true mapping: - dps_val: c value: Celsius @@ -161,3 +179,14 @@ secondary_entities: - dps_val: f value: Fahrenheit icon: "mdi:temperature-fahrenheit" + - entity: binary_sensor + name: Low water + class: problem + category: diagnostic + dps: + - id: 22 + type: bitfield + name: sensor + mapping: + - dps_val: 1 + value: true diff --git a/custom_components/tuya_local/devices/breville_lad208_dehumidifier.yaml b/custom_components/tuya_local/devices/breville_lad208_dehumidifier.yaml new file mode 100644 index 00000000..cde49478 --- /dev/null +++ b/custom_components/tuya_local/devices/breville_lad208_dehumidifier.yaml @@ -0,0 +1,210 @@ +name: Dehumidifier +products: + - id: 6cad6hhp5kbwbtyq + name: Breville Smart Dry Connect Dehumidifier (LAD208) +primary_entity: + entity: humidifier + class: dehumidifier + dps: + - id: 1 + name: switch + type: boolean + mapping: + - dps_val: false + icon: "mdi:air-humidifier-off" + icon_priority: 2 + - dps_val: true + icon: "mdi:air-humidifier" + icon_priority: 4 + - id: 2 + name: mode + type: string + mapping: + - dps_val: 0 + value: "auto" + - dps_val: 1 + value: "boost" + - dps_val: 2 + value: "laundry" + icon: "mdi:t-shirt-crew" + icon_priority: 3 + - dps_val: 3 + value: "purify" + - id: 4 + name: humidity + type: integer + range: + min: 30 + max: 80 + mapping: + - step: 5 + - id: 104 + type: integer + name: current_humidity +secondary_entities: + - entity: fan + name: Fan + icon: "mdi:fan" + category: config + dps: + - id: 1 + type: boolean + name: switch + - id: 6 + type: string + name: speed + mapping: + - dps_val: "1" + value: 50 + - dps_val: "3" + value: 100 + - entity: select + name: Timer + icon: "mdi:timer" + class: duration + category: config + dps: + - id: 12 + type: string + name: option + optional: true + mapping: + - dps_val: "0" + value: "Off" + - dps_val: "1" + value: "1 hour" + - dps_val: "2" + value: "2 hours" + - dps_val: "3" + value: "3 hours" + - dps_val: "4" + value: "4 hours" + - dps_val: "5" + value: "5 hours" + - dps_val: "6" + value: "6 hours" + - dps_val: "7" + value: "7 hours" + - dps_val: "8" + value: "8 hours" + - dps_val: "9" + value: "9 hours" + - dps_val: "10" + value: "10 hours" + - dps_val: "11" + value: "11 hours" + - dps_val: "12" + value: "12 hours" + - dps_val: "13" + value: "13 hours" + - dps_val: "14" + value: "14 hours" + - dps_val: "15" + value: "15 hours" + - dps_val: "16" + value: "16 hours" + - dps_val: "17" + value: "17 hours" + - dps_val: "18" + value: "18 hours" + - dps_val: "19" + value: "19 hours" + - dps_val: "20" + value: "20 hours" + - dps_val: "21" + value: "21 hours" + - dps_val: "22" + value: "22 hours" + - dps_val: "23" + value: "23 hours" + - dps_val: "24" + value: "24 hours" + - entity: sensor + class: humidity + dps: + - id: 104 + type: integer + name: sensor + unit: "%" + class: measurement + - entity: sensor + class: temperature + dps: + - id: 103 + type: integer + name: sensor + unit: C + class: measurement + - entity: switch + name: Sleep + category: config + dps: + - id: 102 + type: boolean + name: switch + mapping: + - dps_val: false + icon: "mdi:sleep-off" + - dps_val: true + icon: "mdi:sleep" + - entity: lock + name: Child lock + category: config + dps: + - id: 7 + type: boolean + name: lock + mapping: + - dps_val: false + icon: "mdi:hand-back-right" + - dps_val: true + icon: "mdi:hand-back-right-off" + - entity: binary_sensor + class: problem + name: Tank full + icon: "mdi:cup-outline" + icon-priority: 2 + dps: + - id: 11 + type: bitfield + name: sensor + optional: true + mapping: + - dps_val: 8 + value: true + icon: "mdi:cup-water" + icon-priority: 1 + - value: false + - entity: binary_sensor + name: Defrost + class: cold + icon: "mdi:snowflake-melt" + category: diagnostic + dps: + - id: 105 + type: boolean + name: sensor + mapping: + - dps_val: false + icon: "mdi:snowflake" + value: false + - dps_val: true + icon: "mdi:snowflake-melt" + value: true + - entity: binary_sensor + class: problem + name: Fault + category: diagnostic + dps: + - id: 11 + type: bitfield + name: sensor + optional: true + mapping: + - dps_val: 0 + value: false + - dps_val: 8 + value: false + - dps_val: null + value: false + - value: true diff --git a/custom_components/tuya_local/devices/caldo_up_t_wifi.yaml b/custom_components/tuya_local/devices/caldo_up_t_wifi.yaml new file mode 100644 index 00000000..34cf2bad --- /dev/null +++ b/custom_components/tuya_local/devices/caldo_up_t_wifi.yaml @@ -0,0 +1,57 @@ +name: Fan heater +products: + - id: dqy0z9997a18rkaw + name: Olimpia Splendid Caldo Up T +primary_entity: + entity: climate + dps: + - id: 1 + type: boolean + name: hvac_mode + mapping: + - dps_val: true + constraint: preset_mode + conditions: + - dps_val: "0" + value: fan_only + - dps_val: "1" + value: heat + - value: heat + - dps_val: false + value: "off" + - id: 2 + type: integer + name: temperature + range: + min: 18 + max: 45 + - id: 3 + type: integer + name: current_temperature + - id: 5 + type: string + name: preset_mode + mapping: + - dps_val: "0" + value: none + - dps_val: "1" + value: comfort + - dps_val: "2" + value: boost + - id: 8 + type: boolean + name: swing_mode + mapping: + - dps_val: false + value: "off" + - dps_val: true + value: "on" +secondary_entities: + - entity: switch + name: Window detection + icon: "mdi:window-open-variant" + category: config + dps: + - id: 101 + type: boolean + name: switch diff --git a/custom_components/tuya_local/devices/cecotec_fan_light.yaml b/custom_components/tuya_local/devices/cecotec_fan_light.yaml new file mode 100644 index 00000000..7ea66bba --- /dev/null +++ b/custom_components/tuya_local/devices/cecotec_fan_light.yaml @@ -0,0 +1,111 @@ +name: Fan with light +products: + - id: 9uydeea5iojq3msy + name: Cecotec AQUA CONNECTED +primary_entity: + entity: fan + translation_key: fan_with_presets + dps: + - id: 1 + type: boolean + name: switch + - id: 2 + type: string + name: preset_mode + mapping: + - dps_val: nature + value: nature + - dps_val: sleep + value: sleep + - dps_val: fresh + value: fresh + - dps_val: smart + value: smart + - dps_val: custom + value: custom + - id: 3 + name: speed + type: string + range: + min: 1 + max: 6 + mapping: + - dps_val: "1" + value: 17 + - dps_val: "2" + value: 33 + - dps_val: "3" + value: 50 + - dps_val: "4" + value: 67 + - dps_val: "5" + value: 83 + - dps_val: "6" + value: 100 + - id: 8 + name: direction + type: string +secondary_entities: + - entity: light + dps: + - id: 15 + type: boolean + name: switch +# I comment this features because that are reported by device but does nothing with it. +# +# {"abilityId":16,"accessMode":"rw","code":"bright_value","description":"","name":"灯光亮度","typeSpec":{"max":100,"min":1,"scale":0,"step":1,"type":"value","typeDefaultValue":1,"unit":""}}, +# {"abilityId":17,"accessMode":"rw","code":"temp_value","description":"","name":"灯光色温","typeSpec":{"max":100,"min":0,"scale":0,"step":1,"type":"value","typeDefaultValue":0,"unit":""}}, +# {"abilityId":19,"accessMode":"rw","code":"work_mode","description":"","name":"灯光模式","typeSpec":{"range":["white","warm","cold","night"],"type":"enum","typeDefaultValue":"white"}}, +# +# +# - id: 16 +# type: integer +# name: brightness +# range: +# min: 25 +# max: 255 +# - id: 17 +# type: integer +# name: color_temp +# range: +# min: 0 +# max: 255 +# - id: 19 +# type: string +# name: color_mode +# optional: true +# mapping: +# - dps_val: white +# value: white +# - dps_val: warm +# value: warm +# - dps_val: cold +# value: cold +# - dps_val: night +# value: night + - entity: select + name: timer + icon: "mdi:timer" + dps: + - id: 22 + name: option + type: string + mapping: + - dps_val: "cancel" + value: "cancel" + - dps_val: "1h" + value: "1 hours" + - dps_val: "2h" + value: "2 hours" + - dps_val: "3h" + value: "3 hours" + - dps_val: "4h" + value: "4 hours" + - dps_val: "5h" + value: "5 hours" + - dps_val: "6h" + value: "6 hours" + - dps_val: "7h" + value: "7 hours" + - dps_val: "8h" + value: "8 hours" diff --git a/custom_components/tuya_local/devices/della_airconditioner.yaml b/custom_components/tuya_local/devices/della_airconditioner.yaml new file mode 100644 index 00000000..c6078d44 --- /dev/null +++ b/custom_components/tuya_local/devices/della_airconditioner.yaml @@ -0,0 +1,168 @@ +name: Della air conditioner +primary_entity: + entity: climate + dps: + - id: 1 + name: hvac_mode + type: boolean + mapping: + - dps_val: false + value: "off" + - dps_val: true + constraint: mode + conditions: + - dps_val: cold + value: cool + - dps_val: hot + value: heat + - dps_val: wet + value: dry + - dps_val: wind + value: fan_only + - dps_val: auto + value: heat_cool + - id: 2 + name: temperature + type: integer + range: + min: 160 + max: 320 + mapping: + - scale: 10 + step: 10 + constraint: temperature_unit + conditions: + - dps_val: F + range: + min: 600 + max: 900 + - id: 3 + name: current_temperature + type: integer + mapping: + - scale: 10 + - id: 4 + name: mode + type: string + hidden: true + - id: 5 + name: fan_mode + type: string + mapping: + - dps_val: low + value: low + - dps_val: mid + value: medium + - dps_val: high + value: high + - dps_val: auto + value: auto + # preset only works in cooling mode + - id: 8 + name: preset_mode + type: boolean + mapping: + - dps_val: true + value: eco + - dps_val: false + value: comfort + - id: 19 + name: temperature_unit + type: string + - id: 105 + name: swing_mode + type: boolean + mapping: + - dps_val: true + value: vertical + - dps_val: false + value: "off" + - id: 107 + type: bitfield + name: fault_code +secondary_entities: + - entity: switch + name: Emergency heat + icon: "mdi:fire" + dps: + - id: 12 + name: switch + type: boolean + - entity: light + name: Backlight + category: config + icon: "mdi:television-ambient-light" + dps: + - id: 13 + name: switch + type: boolean + - entity: lock + name: Child lock + category: config + icon: "mdi:hand-right-back-off" + dps: + - id: 14 + name: lock + type: boolean + - entity: select + name: Temperature unit + icon: "mdi:temperature-celsius" + category: config + dps: + - id: 19 + type: string + name: option + mapping: + - dps_val: C + value: Celsius + - dps_val: F + value: Fahrenheit + - entity: sensor + class: energy + category: diagnostic + dps: + - id: 28 + name: sensor + type: integer + unit: kWh + class: total_increasing + - entity: switch + name: Sleep + category: config + icon: "mdi:power-sleep" + dps: + - id: 102 + name: switch + type: boolean + - entity: switch + name: Clean + dps: + - id: 103 + name: switch + type: boolean + - entity: switch + name: Anti-frost + category: config + dps: + - id: 104 + name: switch + type: boolean + - entity: switch + name: iHealth + icon: "mdi:creation" + dps: + - id: 106 + name: switch + type: boolean + - entity: binary_sensor + name: Fault + class: problem + category: diagnostic + dps: + - id: 107 + name: sensor + type: bitfield + mapping: + - dps_val: 0 + value: false + - value: true diff --git a/custom_components/tuya_local/devices/eurom_alutherm_heater.yaml b/custom_components/tuya_local/devices/eurom_alutherm_heater.yaml index d1a0ce07..f38d9178 100644 --- a/custom_components/tuya_local/devices/eurom_alutherm_heater.yaml +++ b/custom_components/tuya_local/devices/eurom_alutherm_heater.yaml @@ -1,7 +1,9 @@ name: Heater products: - id: 20qAGCEd0AxowwTA - name: Eurom Alutherm heater + name: Eurom Alutherm 2000 + - id: awnds45afwineiul + name: Eurom Alutherm 2500 primary_entity: entity: climate dps: @@ -77,6 +79,7 @@ secondary_entities: - id: 104 type: string name: option + optional: true mapping: - dps_val: holiday value: Holiday @@ -85,3 +88,4 @@ secondary_entities: - id: 103 type: string name: schedule_data + optional: true diff --git a/custom_components/tuya_local/devices/ferroli_titano_twin.yaml b/custom_components/tuya_local/devices/ferroli_titano_twin.yaml new file mode 100644 index 00000000..c2a19575 --- /dev/null +++ b/custom_components/tuya_local/devices/ferroli_titano_twin.yaml @@ -0,0 +1,103 @@ +name: Water heater +products: + - id: lci0ebsz7ftaruaf + name: Ferroli Titano Twin DT EWH +primary_entity: + entity: water_heater + dps: + - id: 1 + name: operation_mode + type: boolean + mapping: + - dps_val: false + value: "off" + - dps_val: true + constraint: work_mode + conditions: + - dps_val: manual + value: electric + - dps_val: eco + value: eco + icon: "mdi:leaf" + - id: 2 + type: string + name: work_mode + hidden: true + - id: 9 + type: integer + name: temperature + range: + min: 40 + max: 80 + mapping: + - step: 5 + unit: C + - id: 10 + type: integer + name: current_temperature + - id: 101 + type: bitfield + name: fault_code + mapping: + - dps_val: 1 + value: E2 Operating without water + - dps_val: 2 + value: E3 NTC temperature sensor + - dps_val: 4 + value: E4 Water overheating + - dps_val: 16 + value: E6 clock RTC failure +secondary_entities: + - entity: switch + name: Anti-legionella + category: config + dps: + - id: 4 + type: boolean + name: switch + mapping: + - dps_val: true + icon: "mdi:shield-cross-outline" + - dps_val: false + icon: "mdi:shield-remove-outline" + - entity: binary_sensor + class: problem + name: Fault + category: diagnostic + dps: + - id: 101 + type: bitfield + name: sensor + mapping: + - dps_val: 0 + value: false + - value: true + - entity: binary_sensor + name: Heating status + class: running + category: diagnostic + dps: + - id: 102 + type: string + name: sensor + mapping: + - dps_val: Heating + value: true + - value: false + - entity: binary_sensor + name: Anti-frost + class: cold + category: diagnostic + dps: + - id: 103 + type: boolean + name: sensor + - entity: sensor + name: Target temperature + class: temperature + category: diagnostic + dps: + - id: 104 + type: integer + name: sensor + unit: C diff --git a/custom_components/tuya_local/devices/fisher_summer_air_conditioner.yaml b/custom_components/tuya_local/devices/fisher_summer_air_conditioner.yaml new file mode 100644 index 00000000..0c0ff548 --- /dev/null +++ b/custom_components/tuya_local/devices/fisher_summer_air_conditioner.yaml @@ -0,0 +1,367 @@ +name: Air conditioner +products: + - id: bf8705744de2dd5ab4ogqj + name: Fisher Summer Air Conditioner +primary_entity: + entity: climate + icon: "mdi:air-conditioner" + translation_key: aircon_extra + dps: + - id: 1 + name: hvac_mode + type: boolean + mapping: + - dps_val: false + value: "off" + icon: "mdi:hvac-off" + - dps_val: true + constraint: mode + conditions: + - dps_val: auto + icon: mdi:thermostat-auto + value: heat_cool + - dps_val: cold + icon: "mdi:snowflake" + value: cool + - dps_val: wind + icon: "mdi:fan" + value: fan_only + - dps_val: wet + icon: "mdi:water" + value: dry + - dps_val: hot + value: heat + icon: "mdi:heat-wave" + - id: 2 + name: temperature + type: integer + range: + min: 160 + max: 310 + mapping: + - scale: 10 + step: 5 + unit: C + - id: 3 + name: current_temperature + type: integer + - id: 4 + name: mode + type: string + - id: 5 + name: fan_mode + type: string + mapping: + - dps_val: auto + value: auto + - dps_val: mute + value: quiet + - dps_val: low + value: low + - dps_val: mid_low + value: medlow + - dps_val: mid + value: medium + - dps_val: mid_high + value: medhigh + - dps_val: high + value: high + - dps_val: strong + value: strong + - id: 18 + name: current_humidity + type: integer + optional: true + - id: 20 + name: fault_code + type: bitfield + - id: 110 + name: functions_available + type: bitfield + # Used to indicate whether this function is available. + # 0. Whether the temperature is adjustable in dehumidification mode + # 1. Whether the temperature is adjustable in air supply mode + # 2. Whether the temperature is adjustable in automatic mode + # 3. Fresh air volume mark + # 4. Vector air supply + # 5. Left and right sweeping air + # 6. Photosensitive + # 7. Intelligent dehumidification and anti-mildew + # 8. Humidity sensor + # 9. Evaporator cleaning + # 10. Save money and see it + # 11. Power statistics + # 12. Generator mode + # 13. High temperature wind/cool wind + # 14. Air quality detection function + # 15. Set to empty (original: humidity function) + # 16. Set to empty (original: equipment operation saves money and visible temperature curve display) + # 17. 8℃ heating + # 18. Filter dirty and clogged function + # ??? - 19 is missing in Tuya json + # 20. presence or absence of PM2.5 + # 21. temperature scale switching, 1 is Fahrenheit, 0 is Celsius + # 22. soft wind + # 23. left and right wide-angle air supply + - id: 123 + name: options + type: string +secondary_entities: + - entity: binary_sensor + name: Fault + class: problem + category: diagnostic + dps: + - id: 20 + type: bitfield + name: sensor + mapping: + - dps_val: 0 + value: false + - value: true + - entity: sensor # no sensor in Fisher Summer AC, returns 0 + class: pm25 + dps: + - id: 101 + name: sensor + type: integer + optional: true + - entity: select + name: Sleep + category: config + dps: + - id: 105 + name: option + type: string + mapping: + - dps_val: off + value: Off + default: true + - dps_val: normal + value: Normal + - dps_val: old + value: Elderly + - dps_val: child + value: Child + optional: true + - entity: select + name: Vertical Sweep + category: config + dps: + - id: 113 + name: option + type: string + mapping: + - dps_val: 0 + value: None + default: true + - dps_val: 1 + value: Upper and lower + - dps_val: 2 + value: Upper + - dps_val: 3 + value: Lower + - entity: select + name: Horizontal Sweep + category: config + dps: + - id: 114 + name: option + type: string + mapping: + - dps_val: 0 + value: None + default: true + - dps_val: 1 + value: Left and Right + - dps_val: 2 + value: Left + - dps_val: 3 + value: Middle + - dps_val: 4 + value: Right + - dps_val: 5 + value: Partial Left + - dps_val: 6 + value: Partial Right + - dps_val: 7 + value: Wide Angle + - entity: select + name: Energy Saving + category: config + dps: + - id: 119 + name: option + type: string + mapping: + - dps_val: 0 + value: None + default: true + - dps_val: 1 + value: Default Power Saving + - dps_val: 2 + value: Quota Power Saving + - dps_val: 3 + value: Fixed Temperature Power Saving + optional: true + - entity: select + name: Generator Mode + category: config + dps: + - id: 120 + name: option + type: string + mapping: + - dps_val: off + value: None + default: true + - dps_val: L1 + value: L1 + - dps_val: L2 + value: L2 + - dps_val: L3 + value: L3 + optional: true + - entity: sensor + name: Air Quality + dps: + - id: 125 + name: sensor + type: string + optional: true + - entity: select + name: Set Vertical Direction # Tuya JSON phrasing: Freeze Vertical + category: config + dps: + - id: 126 + name: option + type: string + mapping: + - dps_val: 0 + value: Freeze Current Position + default: true + - dps_val: 1 + value: Top + - dps_val: 2 + value: Slightly Up + - dps_val: 3 + value: Middle + - dps_val: 4 + value: Slightly Down + - dps_val: 5 + value: Down + - entity: select + name: Set Horizontal Direction # Tuya JSON phrasing: Freeze Horizontal + category: config + dps: + - id: 127 + name: option + type: string + mapping: + - dps_val: 0 + value: Freeze Current Position + default: true + - dps_val: 1 + value: Left + - dps_val: 2 + value: Slightly Left + - dps_val: 3 + value: Middle + - dps_val: 4 + value: Slightly Right + - dps_val: 5 + value: Right + - dps_val: 6 + value: Wide Angle Left + - dps_val: 7 + value: Wide Angle Right + - dps_val: 8 + value: Wide Angle + - entity: select + name: Power + category: config + dps: + - id: 129 + name: option + type: string + mapping: + - dps_val: 1 + value: 1 kWh + - dps_val: 2 + value: 2 kWh + - dps_val: 3 + value: 3 kWh + - dps_val: 4 + value: 4 kWh + - dps_val: 5 + value: 5 kWh + optional: true + - entity: number + name: Power Saving Temperature + category: config + class: temperature + dps: + - id: 130 + name: value + type: integer + unit: C + range: + min: 26 + max: 31 + optional: true + - entity: binary_sensor + name: Dirty Filter + class: problem + category: diagnostic + dps: + - id: 131 + type: boolean + name: sensor + readonly: true + optional: true + - entity: select + name: Hot Cold Wind + category: config + dps: + - id: 132 + name: option + type: boolean + mapping: + - dps_val: true + value: Cold Wind + - dps_val: false + value: Hot wind + optional: true + - entity: select + name: Swing Direction + category: config + dps: + - id: 133 + name: option + type: string + mapping: + - dps_val: 0 + value: None + default: true + - dps_val: 1 + value: Horizontal Only + - dps_val: 2 + value: Vertical Only + - dps_val: 3 + value: Horizontal and Vertical + - entity: sensor + name: Work Time + dps: + - id: 134 + name: sensor + type: string + optional: true + - entity: sensor + name: Running Time + class: duration + dps: + - id: 135 + name: sensor + type: integer + unit: s + optional: true diff --git a/custom_components/tuya_local/devices/hotshot2000_heater.yaml b/custom_components/tuya_local/devices/hotshot2000_heater.yaml new file mode 100644 index 00000000..1a115060 --- /dev/null +++ b/custom_components/tuya_local/devices/hotshot2000_heater.yaml @@ -0,0 +1,75 @@ +name: HOT SHOT 2000 WIFI +products: + - id: lgn0xaegjbodrjax + name: EUROM Hot-Shot 2000 WiFi +primary_entity: + entity: climate + dps: + - id: 1 + type: boolean + name: hvac_mode + mapping: + - dps_val: false + value: "off" + - dps_val: true + constraint: work_mode + conditions: + - dps_val: level1 + value: fan_only + - dps_val: level2 + value: heat + - dps_val: level3 + value: heat + - id: 2 + type: integer + name: temperature + range: + min: 5 + max: 37 + - id: 3 + type: integer + name: current_temperature + - id: 5 + name: work_mode + type: string + hidden: true + - id: 6 + name: preset_mode + type: boolean + mapping: + - dps_val: false + constraint: work_mode + conditions: + - dps_val: "level1" + value: none + hidden: true + - dps_val: "level2" + value: comfort + - dps_val: "level3" + value: boost + - dps_val: true + value: eco + - id: 8 + type: boolean + name: swing_mode + mapping: + - dps_val: false + value: "off" + - dps_val: true + value: "on" +secondary_entities: + - entity: switch + name: Mode indicator + category: config + dps: + - id: 10 + type: boolean + name: switch + - entity: sensor + name: Remaining Time + class: duration + dps: + - id: 12 + type: integer + name: sensor + unit: min diff --git a/custom_components/tuya_local/devices/its_45hd_heatpump.yaml b/custom_components/tuya_local/devices/its_45hd_heatpump.yaml index 3af00f36..632e89bf 100644 --- a/custom_components/tuya_local/devices/its_45hd_heatpump.yaml +++ b/custom_components/tuya_local/devices/its_45hd_heatpump.yaml @@ -233,6 +233,17 @@ secondary_entities: - id: 31 type: boolean name: sensor + - entity: binary_sensor + name: Aux heat + class: running + category: diagnostic + dps: + - id: 32 + type: boolean + name: sensor + mapping: + - dps_val: true + icon: "mdi:fire" - entity: binary_sensor name: High pressure valve class: opening diff --git a/custom_components/tuya_local/devices/klarstein_dryfy_pro_connect_dehumidifier.yaml b/custom_components/tuya_local/devices/klarstein_dryfy_pro_connect_dehumidifier.yaml index 8d8e361c..7b0c6ed7 100644 --- a/custom_components/tuya_local/devices/klarstein_dryfy_pro_connect_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/klarstein_dryfy_pro_connect_dehumidifier.yaml @@ -1,130 +1,131 @@ -name: Klarstein DryFy Pro Connect -# {'updated_at': 1674605185.2896934, '1': True, '2': 'auto', '3': 57, '4': 55, '10': True, '101': True, '102': '0_90', '103': 24} -products: - - id: 6cguug02fnygou5c -primary_entity: - entity: humidifier - class: dehumidifier - dps: - - id: 1 - name: switch - type: boolean - - id: 2 - name: mode - type: string - optional: true - mapping: - - dps_val: auto - value: auto - - dps_val: high - value: boost - - dps_val: low - value: eco - - dps_val: fan - value: purify - - id: 3 - type: integer - name: current_humidity - - id: 4 - type: integer - name: humidity - range: - min: 35 - max: 80 - mapping: - - step: 5 -secondary_entities: - - entity: fan - deprecated: humidifier mode - dps: - - id: 1 - name: switch - type: boolean - - id: 2 - name: preset_mode - type: string - optional: true - mapping: - - dps_val: auto - value: auto - - dps_val: high - value: high - - dps_val: low - value: low - - dps_val: fan - value: Fan - - id: 102 - name: oscillate - type: string - optional: true - mapping: - - dps_val: "0_90" - value: true - - dps_val: "45" - value: false - - dps_val: "90" - value: false - - entity: select - name: Direction - category: config - icon: "mdi:sprinkler-variant" - dps: - - id: 102 - name: option - type: string - optional: true - mapping: - - dps_val: "0_90" - value: "45°-90°" - - dps_val: "45" - value: "45°" - - dps_val: "90" - value: "90°" - - entity: sensor - name: Current humidity - deprecated: humidifier - category: diagnostic - class: humidity - dps: - - id: 3 - type: integer - name: sensor - class: measurement - unit: "%" - - entity: sensor - class: temperature - dps: - - id: 103 - type: integer - name: sensor - unit: C - class: measurement - - entity: switch - name: UV sterilization - icon: "mdi:shield-half-full" - dps: - - id: 10 - name: switch - type: boolean - - entity: switch - name: Ionizer - icon: "mdi:creation" - dps: - - id: 5 - name: switch - type: boolean - optional: true - mapping: - - dps_val: false - value: true - - dps_val: true - value: false - - entity: switch - name: "Humidity indicator" - category: config - icon: "mdi:dots-circle" - dps: - - id: 101 - name: switch - type: boolean - +name: Dehumidifier +# {'updated_at': 1674605185.2896934, '1': True, '2': 'auto', '3': 57, '4': 55, '10': True, '101': True, '102': '0_90', '103': 24} +products: + - id: 6cguug02fnygou5c + name: Klarstein Dryfy Pro Connect +primary_entity: + entity: humidifier + class: dehumidifier + dps: + - id: 1 + name: switch + type: boolean + - id: 2 + name: mode + type: string + optional: true + mapping: + - dps_val: auto + value: auto + - dps_val: high + value: boost + - dps_val: low + value: eco + - dps_val: fan + value: purify + - id: 3 + type: integer + name: current_humidity + - id: 4 + type: integer + name: humidity + range: + min: 35 + max: 80 + mapping: + - step: 5 +secondary_entities: + - entity: fan + deprecated: humidifier mode + dps: + - id: 1 + name: switch + type: boolean + - id: 2 + name: preset_mode + type: string + optional: true + mapping: + - dps_val: auto + value: auto + - dps_val: high + value: high + - dps_val: low + value: low + - dps_val: fan + value: Fan + - id: 102 + name: oscillate + type: string + optional: true + mapping: + - dps_val: "0_90" + value: true + - dps_val: "45" + value: false + - dps_val: "90" + value: false + - entity: select + name: Direction + category: config + icon: "mdi:sprinkler-variant" + dps: + - id: 102 + name: option + type: string + optional: true + mapping: + - dps_val: "0_90" + value: "45°-90°" + - dps_val: "45" + value: "45°" + - dps_val: "90" + value: "90°" + - entity: sensor + name: Current humidity + deprecated: humidifier + category: diagnostic + class: humidity + dps: + - id: 3 + type: integer + name: sensor + class: measurement + unit: "%" + - entity: sensor + class: temperature + dps: + - id: 103 + type: integer + name: sensor + unit: C + class: measurement + - entity: switch + name: UV sterilization + icon: "mdi:shield-half-full" + dps: + - id: 10 + name: switch + type: boolean + - entity: switch + name: Ionizer + icon: "mdi:creation" + dps: + - id: 5 + name: switch + type: boolean + optional: true + mapping: + - dps_val: false + value: true + - dps_val: true + value: false + - entity: switch + name: "Humidity indicator" + category: config + icon: "mdi:dots-circle" + dps: + - id: 101 + name: switch + type: boolean + diff --git a/custom_components/tuya_local/devices/kogan_kasthfp2kwa_towerheater.yaml b/custom_components/tuya_local/devices/kogan_kasthfp2kwa_towerheater.yaml index 718e12f1..b475831a 100644 --- a/custom_components/tuya_local/devices/kogan_kasthfp2kwa_towerheater.yaml +++ b/custom_components/tuya_local/devices/kogan_kasthfp2kwa_towerheater.yaml @@ -1,4 +1,7 @@ -name: Kogan tower heater +name: Tower heater +products: + - id: jyota3jcxuelyf9t + name: Kogan KASTHFP2KWA primary_entity: entity: climate dps: diff --git a/custom_components/tuya_local/devices/kogan_kawfhtp_heater.yaml b/custom_components/tuya_local/devices/kogan_kawfhtp_heater.yaml index 7abe7b6d..dd9ae862 100644 --- a/custom_components/tuya_local/devices/kogan_kawfhtp_heater.yaml +++ b/custom_components/tuya_local/devices/kogan_kawfhtp_heater.yaml @@ -1,59 +1,59 @@ -name: Kogan glass panel heater -primary_entity: - entity: climate - dps: - - id: 1 - type: boolean - mapping: - - dps_val: false - value: "off" - icon: "mdi:radiator-disabled" - - dps_val: true - value: "heat" - icon: "mdi:radiator" - name: hvac_mode - - id: 3 - type: integer - range: - min: 5 - max: 40 - name: temperature - - id: 4 - type: integer - name: current_temperature - - id: 5 - type: integer - name: timer - - id: 7 - type: string - mapping: - - dps_val: Low - value: eco - - dps_val: High - value: boost - name: preset_mode -secondary_entities: - - entity: lock - name: Child lock - category: config - dps: - - id: 2 - type: boolean - name: lock - mapping: - - dps_val: true - icon: "mdi:hand-back-right-off" - - dps_val: false - icon: "mdi:hand-back-right" - - entity: number - name: Timer - icon: "mdi:timer" - category: config - dps: - - id: 5 - type: integer - name: value - unit: min - range: - min: 0 - max: 1440 +name: Panel heater +products: + - id: jyota3jcxuelyf9t + name: Kogan NPH-2000G-WIFI glass panel heater +primary_entity: + entity: climate + dps: + - id: 1 + type: boolean + mapping: + - dps_val: false + value: "off" + icon: "mdi:radiator-disabled" + - dps_val: true + value: "heat" + icon: "mdi:radiator" + name: hvac_mode + - id: 3 + type: integer + range: + min: 5 + max: 40 + name: temperature + - id: 4 + type: integer + name: current_temperature + - id: 7 + type: string + mapping: + - dps_val: Low + value: eco + - dps_val: High + value: boost + name: preset_mode +secondary_entities: + - entity: lock + name: Child lock + category: config + dps: + - id: 2 + type: boolean + name: lock + mapping: + - dps_val: true + icon: "mdi:hand-back-right-off" + - dps_val: false + icon: "mdi:hand-back-right" + - entity: number + name: Timer + icon: "mdi:timer" + category: config + dps: + - id: 5 + type: integer + name: value + unit: min + range: + min: 0 + max: 1440 diff --git a/custom_components/tuya_local/devices/kogan_lx10_vacuum.yaml b/custom_components/tuya_local/devices/kogan_lx10_vacuum.yaml index 50216bbc..85fcf81c 100644 --- a/custom_components/tuya_local/devices/kogan_lx10_vacuum.yaml +++ b/custom_components/tuya_local/devices/kogan_lx10_vacuum.yaml @@ -89,8 +89,12 @@ primary_entity: name: error # robot_fault type: bitfield mapping: + - dps_val: 2 + value: Battery low - dps_val: 32 value: Drop sensor abnormal + - dps_val: 4096 + value: Abnormal main brush - dps_val: 524288 value: Machine trapped - dps_val: 1048576 diff --git a/custom_components/tuya_local/devices/lublueblu_sl60d_vacuum.yaml b/custom_components/tuya_local/devices/lublueblu_sl60d_vacuum.yaml new file mode 100644 index 00000000..b043c774 --- /dev/null +++ b/custom_components/tuya_local/devices/lublueblu_sl60d_vacuum.yaml @@ -0,0 +1,240 @@ +name: Robot vacuum +products: + - id: tdxitkhbixikp8eh + name: Lubluelu SL60D +primary_entity: + entity: vacuum + dps: + - id: 1 + type: boolean + name: power + - id: 2 + type: boolean + name: activate + - id: 3 + type: boolean + name: charge + - id: 4 + type: string + name: command + mapping: + - dps_val: smart + value: smart + - dps_val: chargego + value: return_to_base + - dps_val: zone + value: zone + - dps_val: pose + value: clean_spot + - dps_val: part + value: partial + - id: 5 + type: string + name: status + mapping: + - dps_val: standby + value: standby + - dps_val: zone_clean + value: zone + - dps_val: part_clean + value: partial + - dps_val: cleaning + value: cleaning + - dps_val: paused + value: paused + - dps_val: goto_pos + value: seeking_spot + - dps_val: pos_arrived + value: located spot + - dps_val: pos_unarrive + value: left_spot + - dps_val: goto_charge + value: returning + - dps_val: charging + value: charging + - dps_val: charge_done + value: sleep + - dps_val: sleep + - id: 9 + type: string + name: fan_speed + mapping: + - dps_val: gentle + value: Low + - dps_val: normal + value: Medium + - dps_val: strong + value: High + - id: 11 + type: boolean + name: locate + - id: 12 + type: string + name: direction_control + mapping: + - dps_val: forward + value: forward + - dps_val: backward + value: reverse + - dps_val: turn_left + value: left + - dps_val: turn_right + value: right + - dps_val: stop + value: stop + - id: 27 + type: boolean + name: break_clean + - id: 28 + type: bitfield + name: error + +secondary_entities: + - entity: sensor + name: Cleaning time + icon: "mdi:progress-clock" + class: duration + category: diagnostic + dps: + - id: 6 + type: integer + name: sensor + unit: min + - entity: sensor + name: Cleaning area + category: diagnostic + icon: "mdi:floor-plan" + dps: + - id: 7 + type: integer + name: sensor + unit: m2 + - entity: sensor + class: battery + dps: + - id: 8 + type: integer + name: sensor + unit: "%" + class: measurement + - entity: sensor + name: Water tank + category: diagnostic + class: enum + icon: "mdi:cup-water" + dps: + - id: 10 + type: string + name: sensor + mapping: + - dps_val: closed + value: Closed + - dps_val: low + value: Low + - dps_val: middle + value: Medium + - dps_val: high + value: High + - entity: sensor + name: Side brush lifetime + category: diagnostic + class: duration + dps: + - id: 17 + type: integer + name: sensor + unit: h + - entity: sensor + name: Rolling brush lifetime + category: diagnostic + class: duration + dps: + - id: 19 + type: integer + name: sensor + unit: h + - entity: sensor + name: Filter lifetime + category: diagnostic + class: duration + dps: + - id: 21 + type: integer + name: sensor + unit: h + - entity: sensor + name: Duster cloth lifetime + category: diagnostic + class: duration + dps: + - id: 23 + type: integer + name: sensor + unit: min + - entity: sensor + name: Total cleaning area + icon: "mdi:texture-box" + category: diagnostic + dps: + - id: 29 + type: integer + name: sensor + unit: m2 + - entity: sensor + name: Total cleaning times + icon: "mdi:counter" + category: diagnostic + dps: + - id: 30 + type: integer + name: sensor + - entity: sensor + name: Total cleaning time + class: duration + icon: "mdi:history" + category: diagnostic + dps: + - id: 31 + type: integer + name: sensor + unit: min + - entity: button + name: Reset map + icon: "mdi:map-marker-remove" + category: config + dps: + - id: 13 + type: boolean + name: button + - entity: button + name: Reset edge brush + class: restart + category: config + dps: + - id: 18 + type: boolean + name: button + - entity: button + name: Reset roll brush + class: restart + category: config + dps: + - id: 20 + type: boolean + name: button + - entity: button + name: Reset filter + icon: "mdi:air-filter" + category: config + dps: + - id: 22 + type: boolean + name: button + - entity: switch + name: Do not disturb + icon: "mdi:minus-circle" + category: config + dps: + - id: 25 + type: boolean + name: switch diff --git a/custom_components/tuya_local/devices/modernflames_orion_fireplace.yaml b/custom_components/tuya_local/devices/modernflames_orion_fireplace.yaml new file mode 100644 index 00000000..ab3cff59 --- /dev/null +++ b/custom_components/tuya_local/devices/modernflames_orion_fireplace.yaml @@ -0,0 +1,333 @@ +name: Fireplace +products: + - id: buigpagr3xzmj6zk + name: Modern Flames Orion +primary_entity: + entity: climate + icon: "mdi:campfire" + dps: + - id: 1 + name: hvac_mode + type: boolean + mapping: + - dps_val: false + value: "off" + - dps_val: true + constraint: preset_mode + conditions: + - dps_val: HIGH_HEAT + value: heat + - dps_val: LOW_HEAT + value: heat + hidden: true + - dps_val: FAN + value: fan_only + - dps_val: "OFF" + value: "off" + hidden: true + - id: 2 + name: temperature + type: integer + range: + min: 20 + max: 31 + mapping: + - constraint: temperature_unit + conditions: + - dps_val: f + value_redirect: temp_set_f + range: + min: 68 + max: 90 + - id: 9 + name: temperature_unit + type: string + mapping: + - dps_val: f + value: F + - dps_val: c + value: C + - id: 10 + name: temp_set_f + type: integer + range: + min: 68 + max: 90 + hidden: true + - id: 113 + name: preset_mode + type: string + mapping: + - dps_val: "OFF" + value: none + - dps_val: "FAN" + value: Fan only + - dps_val: "LOW_HEAT" + value: eco + - dps_val: "HIGH_HEAT" + value: boost + - id: 122 + name: custom + type: string + optional: true + - id: 123 + type: string + name: save_custom + optional: true +secondary_entities: + - entity: select + name: Temperature unit + icon: "mdi:temperature-celsius" + category: config + dps: + - id: 9 + type: string + name: option + mapping: + - dps_val: c + value: Celsius + - dps_val: f + value: Fahrenheit + - entity: select + name: Timer + icon: "mdi:timer" + category: config + dps: + - id: 13 + type: string + name: option + mapping: + - dps_val: "00" + value: "Off" + - dps_val: "30" + value: "30 minutes" + - dps_val: "1h" + value: "1 hour" + - dps_val: "2h" + value: "2 hours" + - dps_val: "3h" + value: "3 hours" + - dps_val: "4h" + value: "4 hours" + - dps_val: "5h" + value: "5 hours" + - dps_val: "6h" + value: "6 hours" + - dps_val: "7h" + value: "7 hours" + - dps_val: "8h" + value: "8 hours" + - id: 114 + type: string + optional: true + name: week_program_1 + - id: 115 + type: string + optional: true + name: week_program_2 + - id: 116 + type: string + optional: true + name: week_program_3 + - id: 117 + type: string + optional: true + name: week_program_4 + - id: 118 + type: string + optional: true + name: week_program_5 + - id: 119 + type: string + optional: true + name: week_program_6 + - id: 120 + type: string + optional: true + name: week_program_7 + - entity: sensor + name: Time remaining + class: duration + category: diagnostic + dps: + - id: 14 + type: integer + name: sensor + unit: s + - entity: select + name: Flame style + icon: "mdi:fire" + category: config + dps: + - id: 101 + type: string + name: option + mapping: + - dps_val: ONE + value: One + - dps_val: TWO + value: Two + - dps_val: THREE + value: Three + - entity: light + name: Flame + category: config + dps: + - id: 104 + name: brightness + type: string + mapping: + - dps_val: OFF + value: 0 + - dps_val: DEFAULT + value: 82 + - dps_val: MEDIUM + value: 164 + - dps_val: HIGH + value: 255 + - id: 102 + name: effect + type: string + mapping: + - dps_val: YELLOW + value: Yellow + - dps_val: ORANGE + value: Orange + - dps_val: BLUE + value: Blue + - dps_val: GREEN + value: Green + - dps_val: PURPLE + value: Purple + - dps_val: WHITE + value: White + - entity: select + name: Flame speed + icon: "mdi:fire" + category: config + dps: + - id: 103 + type: string + name: option + mapping: + - dps_val: SLOW + value: Slow + - dps_val: DEFAULT + value: Default + - dps_val: FAST + value: Fast + - entity: light + name: Downlight + icon: "mdi:spotlight-beam" + category: config + dps: + - id: 106 + name: brightness + type: integer + range: + min: 0 + max: 100 + mapping: + - scale: 0.392 + - id: 105 + name: effect + type: string + mapping: + - dps_val: "1" + value: Orange + - dps_val: "2" + value: Red + - dps_val: "3" + value: Blue + - dps_val: "4" + value: Yellow + - dps_val: "5" + value: Green + - dps_val: "6" + value: Purple + - dps_val: "7" + value: Sky blue + - dps_val: "8" + value: Magenta + - dps_val: "9" + value: White + - dps_val: "10" + value: Pink + - entity: switch + name: Downlight night mode + category: config + icon: "mdi:power-sleep" + dps: + - id: 107 + type: boolean + name: switch + - entity: switch + name: Downlight color cycle + icon: "mdi:spotlight-beam" + category: config + dps: + - id: 108 + type: boolean + name: switch + - entity: light + name: Embers + category: config + icon: "mdi:campfire" + dps: + - id: 110 + name: brightness + type: integer + range: + min: 0 + max: 100 + mapping: + - scale: 0.392 + - id: 109 + name: effect + type: string + mapping: + - dps_val: "1" + value: Orange + - dps_val: "2" + value: Red + - dps_val: "3" + value: Blue + - dps_val: "4" + value: Yellow + - dps_val: "5" + value: Green + - dps_val: "6" + value: Purple + - dps_val: "7" + value: Sky blue + - dps_val: "8" + value: Magenta + - dps_val: "9" + value: White + - dps_val: "10" + value: Pink + - entity: switch + name: Ember extras + icon: "mdi:campfire" + category: config + dps: + - id: 111 + type: boolean + name: switch + - entity: switch + name: Ember color cycle + icon: "mdi:campfire" + category: config + dps: + - id: 112 + type: boolean + name: switch + - entity: button + name: Factory reset + class: restart + category: config + dps: + - id: 121 + type: boolean + name: button + optional: true diff --git a/custom_components/tuya_local/devices/momcozy_white_noise_machine_v2.yaml b/custom_components/tuya_local/devices/momcozy_white_noise_machine_v2.yaml index 168f2151..1851d351 100644 --- a/custom_components/tuya_local/devices/momcozy_white_noise_machine_v2.yaml +++ b/custom_components/tuya_local/devices/momcozy_white_noise_machine_v2.yaml @@ -179,7 +179,6 @@ secondary_entities: - id: 101 name: lock type: boolean - optional: true mapping: - dps_val: true icon: "mdi:hand-back-right-off" @@ -192,6 +191,5 @@ secondary_entities: dps: - id: 104 name: sensor - type: string + type: integer unit: "s" - optional: true diff --git a/custom_components/tuya_local/devices/mrc_magnum_floorheater.yaml b/custom_components/tuya_local/devices/mrc_magnum_floorheater.yaml index 45fb4a42..a3ce43c1 100644 --- a/custom_components/tuya_local/devices/mrc_magnum_floorheater.yaml +++ b/custom_components/tuya_local/devices/mrc_magnum_floorheater.yaml @@ -113,6 +113,7 @@ secondary_entities: - id: 102 type: string name: option + optional: true mapping: - dps_val: "0" value: "0.1" @@ -120,6 +121,9 @@ secondary_entities: value: "0.5" - dps_val: "2" value: "1.0" + - dps_val: null + value: Not set + hidden: true - entity: number name: Setback adjustment category: config @@ -128,6 +132,7 @@ secondary_entities: - id: 103 type: integer name: value + optional: true range: min: 2 max: 8 diff --git a/custom_components/tuya_local/devices/nedis_ptc_fan_heater.yaml b/custom_components/tuya_local/devices/nedis_ptc_fan_heater.yaml new file mode 100644 index 00000000..c55454f8 --- /dev/null +++ b/custom_components/tuya_local/devices/nedis_ptc_fan_heater.yaml @@ -0,0 +1,90 @@ +name: Fan heater +products: + - id: gzmby6hypv4daebf + name: Nedis Ceramic PTC HTFA22WTW +primary_entity: + entity: climate + dps: + - id: 1 + type: boolean + name: hvac_mode + mapping: + - dps_val: false + value: "off" + - dps_val: true + constraint: preset_mode + conditions: + - dps_val: level_1 + value: fan_only + - dps_val: level_2 + value: heat + - dps_val: level_3 + value: heat + - id: 2 + type: integer + name: temperature + range: + min: 10 + max: 49 + - id: 3 + type: integer + name: current_temperature + - id: 5 + name: preset_mode + type: string + mapping: + - dps_val: "level_1" + value: none + hidden: true + - dps_val: "level_2" + value: comfort + - dps_val: "level_3" + value: boost + - id: 8 + type: boolean + name: swing_mode + mapping: + - dps_val: false + value: "off" + - dps_val: true + value: "on" +secondary_entities: + - entity: light + name: Indicator + category: config + icon: "mdi:led-on" + dps: + - id: 10 + type: boolean + name: switch + - entity: select + name: Timer + icon: "mdi:timer" + category: config + dps: + - id: 19 + name: option + type: string + mapping: + - dps_val: "cancel" + value: Cancel + - dps_val: "1h" + value: "1 hour" + - dps_val: "2h" + value: "2 hours" + - dps_val: "2h" + value: "3 hours" + - dps_val: "3h" + value: "4 hours" + - dps_val: "4h" + value: "5 hours" + - dps_val: "5h" + value: "6 hours" + - entity: sensor + name: Remaining time + class: duration + dps: + - id: 20 + type: integer + name: sensor + unit: min diff --git a/custom_components/tuya_local/devices/nx_100ap_air_purifier.yaml b/custom_components/tuya_local/devices/nx_100ap_air_purifier.yaml new file mode 100644 index 00000000..3a9fdb62 --- /dev/null +++ b/custom_components/tuya_local/devices/nx_100ap_air_purifier.yaml @@ -0,0 +1,127 @@ +name: Air purifier +products: + - id: xhrfqobcbyk2br0z + name: NX-100AP Rapid +primary_entity: + entity: fan + translation_key: fan_with_presets + dps: + - id: 1 + name: switch + type: boolean + icon: "mdi:air-purifier" + - id: 3 + name: preset_mode + type: string + mapping: + - dps_val: Sleep + value: sleep + - dps_val: M + value: normal + - dps_val: H + value: strong + - dps_val: Auto + value: smart +secondary_entities: + - entity: sensor + name: Timer remaining + class: duration + icon: "mdi:timer" + dps: + - id: 19 + name: sensor + type: integer + unit: min + - entity: sensor + name: Air quality + class: enum + icon: "mdi:air-filter" + dps: + - id: 21 + name: sensor + type: string + mapping: + - dps_val: "good" + value: "Good" + - dps_val: "medium" + value: "Medium" + - dps_val: "severe" + value: "Severe" + - entity: sensor + class: pm25 + dps: + - id: 2 + name: sensor + type: integer + class: measurement + unit: ugm3 + - entity: select + name: Timer + category: config + icon: "mdi:timer" + dps: + - id: 18 + type: string + name: option + mapping: + - dps_val: "Cancel" + value: "Cancel" + - dps_val: "2H" + value: "2 hours" + - dps_val: "4H" + value: "4 hours" + - dps_val: "6H" + value: "6 hours" + - dps_val: "8H" + value: "8 hours" + - dps_val: "10H" + value: "10 hours" + - dps_val: "12H" + value: "12 hours" + - dps_val: "24H" + value: "24 hours" + - entity: button + name: Filter reset + category: config + class: restart + dps: + - id: 11 + type: boolean + name: button + - entity: switch + name: Ionizer + category: config + icon: "mdi:dots-hexagon" + dps: + - id: 6 + name: switch + type: boolean + - entity: switch + name: UV sterilization + category: config + icon: "mdi:sun-wireless" + dps: + - id: 9 + name: switch + type: boolean + - entity: sensor + name: Filter used + category: diagnostic + icon: "mdi:ticket-percent-outline" + dps: + - id: 5 + name: sensor + type: integer + unit: "%" + - entity: binary_sensor + name: Fault + category: diagnostic + class: problem + dps: + - id: 22 + name: sensor + type: bitfield + mapping: + - dps_val: 0 + value: false + - value: true diff --git a/custom_components/tuya_local/devices/petlibro_PLAF103_feeder.yaml b/custom_components/tuya_local/devices/petlibro_PLAF103_feeder.yaml new file mode 100644 index 00000000..ce00b630 --- /dev/null +++ b/custom_components/tuya_local/devices/petlibro_PLAF103_feeder.yaml @@ -0,0 +1,219 @@ +name: Pet feeder +products: + - id: tyjxq8vanjxpn7kb + name: Petlibro PLAF103 +primary_entity: + entity: sensor + name: Status + class: enum + icon: "mdi:paw" + dps: + - id: 4 + type: string + name: sensor + mapping: + - dps_val: standby + value: Idle + - dps_val: no_food + value: Empty + - dps_val: error_ir + value: Fault + - dps_val: feed_timeout + value: Blockage + - dps_val: feeding + value: Feeding + - dps_val: feed_end + value: Feeding complete + - id: 1 + name: meal_plan + type: string + optional: true + - id: 14 + name: fault_code + type: bitfield +secondary_entities: + - entity: number + name: Manual feed + icon: "mdi:food-drumstick" + dps: + - id: 3 + type: integer + name: value + range: + min: 1 + max: 50 + - entity: button + name: Factory reset + class: restart + category: config + dps: + - id: 9 + type: boolean + name: button + optional: true + - entity: sensor + class: battery + category: diagnostic + dps: + - id: 11 + type: integer + name: sensor + unit: "%" + class: measurement + - entity: binary_sensor + name: Fault + class: problem + category: diagnostic + dps: + - id: 14 + type: bitfield + name: sensor + mapping: + - dps_val: 0 + value: false + - value: true + - entity: sensor + name: Last amount + category: diagnostic + dps: + - id: 15 + type: integer + name: sensor + unit: portions + optional: true + - id: 115 + type: integer + name: manual + optional: true + - id: 118 + name: offline + type: string + optional: true + - entity: number + name: Recording playback + category: config + icon: "mdi:account-voice" + dps: + - id: 18 + type: integer + name: value + range: + min: 0 + max: 10 + - id: 116 + name: filename + type: string + - entity: binary_sensor + class: plug + category: diagnostic + dps: + - id: 101 + type: string + name: sensor + mapping: + - dps_val: strong_power + value: true + - dps_val: battery_power + value: false + - entity: select + name: Recording operation + icon: "mdi:cassette" + category: config + dps: + - id: 102 + type: string + name: option + mapping: + - dps_val: player + value: Play + - dps_val: del + value: Erase + - dps_val: record_start + value: Record + - dps_val: record_stop + value: Stop + - entity: binary_sensor + name: Recordings available + class: sound + category: diagnostic + dps: + - id: 103 + type: string + name: sensor + mapping: + - dps_val: no_voice + value: false + - dps_val: have_voice + value: true + - entity: binary_sensor + name: Food level + class: battery + icon: "mdi:drumstick" + category: diagnostic + dps: + - id: 108 + type: string + name: sensor + mapping: + - dps_val: full + value: false + - dps_val: lack + value: true + - entity: binary_sensor + name: Recording + class: running + category: diagnostic + dps: + - id: 109 + type: string + name: sensor + mapping: + - dps_val: record_start + value: true + - dps_val: record_end + value: false + - entity: sensor + name: Recordings + category: diagnostic + dps: + - id: 110 + type: integer + name: sensor + optional: true + - entity: switch + name: Logging + icon: "mdi:script" + category: config + dps: + - id: 112 + type: boolean + name: switch + - entity: light + name: Indicator + category: config + dps: + - id: 113 + type: boolean + name: switch + - entity: binary_sensor + name: WiFi + class: connectivity + category: diagnostic + dps: + - id: 117 + type: boolean + name: sensor + # this is documented as "wifi_off", so assume values are inverted + mapping: + - dps_val: true + value: false + - dps_val: false + value: true + - id: 114 + type: integer + name: signal_strength + optional: true + - id: 119 + type: integer + name: reconnects + optional: true diff --git a/custom_components/tuya_local/devices/qlima_d820a_dehumidifier.yaml b/custom_components/tuya_local/devices/qlima_d820a_dehumidifier.yaml new file mode 100644 index 00000000..c9ca5b25 --- /dev/null +++ b/custom_components/tuya_local/devices/qlima_d820a_dehumidifier.yaml @@ -0,0 +1,188 @@ +name: Dehumidifier +products: + - id: bfba28a17b4fe4e87aljv2 + name: Qlima D820A +primary_entity: + entity: humidifier + class: dehumidifier + dps: + - id: 1 + type: boolean + name: switch + - id: 3 + type: integer + name: humidity + range: + min: 35 + max: 80 + mapping: + - step: 5 + - id: 5 + type: string + name: mode + mapping: + - dps_val: dry_clothes + value: laundry + - dps_val: sleep_mode + value: sleep + - dps_val: manual_dehumidify + value: normal + - dps_val: auto + value: auto + - id: 6 + type: integer + name: current_humidity + - id: 19 + type: bitfield + name: fault_code +secondary_entities: + - entity: fan + dps: + - id: 1 + type: boolean + name: switch + - id: 4 + type: string + name: speed + mapping: + - constraint: mode + conditions: + - dps_val: airpurify + value_redirect: purify_speed + - mapping: + - dps_val: low + value: 33 + - dps_val: mid + value: 67 + - dps_val: high + value: 100 + - id: 8 + type: boolean + name: oscillate + - id: 103 + type: string + name: purify_speed + mapping: + - dps_val: high + value: 100 + - dps_val: mid + value: 67 + - dps_val: low + value: 33 + - id: 105 + type: string + name: mode + - entity: binary_sensor + name: Fault + class: problem + category: diagnostic + dps: + - id: 19 + type: bitfield + name: sensor + mapping: + - dps_val: 0 + value: false + - value: true + - entity: select + name: Indicators + icon: "mdi:led-on" + category: config + dps: + - id: 104 + type: string + name: option + mapping: + - dps_val: "1" + value: "Humidity off" + - dps_val: "2" + value: "All off" + - dps_val: "3" + value: "All on" + - entity: select + name: Operating mode + dps: + - id: 105 + type: string + name: option + mapping: + - dps_val: dehum_air + value: Dehumidify only + icon: "mdi:water-percent" + - dps_val: airpurify + value: Purify only + icon: "mdi:air-filter" + - dps_val: dehum30_air + value: Both + icon: "mdi:air-humidifier" + - entity: switch + name: Internal dry + category: config + dps: + - id: 108 + type: boolean + name: switch + - entity: switch + name: Silent + icon: "mdi:volume-mute" + category: config + dps: + - id: 109 + type: boolean + name: switch + - entity: lock + name: Child lock + icon: "mdi:hand-back-right-off" + category: config + dps: + - id: 16 + type: boolean + name: lock + - entity: sensor + class: temperature + category: diagnostic + dps: + - id: 7 + type: integer + name: sensor + unit: C + class: measurement + - entity: select + name: Timer + icon: "mdi:timer" + category: config + dps: + - id: 17 + type: string + name: option + mapping: + - dps_val: cancel + value: "Off" + - dps_val: "1h" + value: "1 hour" + - dps_val: "2h" + value: "2 hours" + - dps_val: "3h" + value: "3 hours" + - entity: sensor + name: Time remaining + class: duration + category: diagnostic + dps: + - id: 18 + type: integer + name: sensor + unit: min + - entity: switch + name: Sleep + icon: "mdi:power-sleep" + category: config + dps: + - id: 102 + type: string + name: switch + mapping: + - dps_val: manual + value: false + - dps_val: night + value: true diff --git a/custom_components/tuya_local/devices/sendo_airconditioner_c.yaml b/custom_components/tuya_local/devices/sendo_airconditioner_c.yaml index c3f2068a..f9df5511 100644 --- a/custom_components/tuya_local/devices/sendo_airconditioner_c.yaml +++ b/custom_components/tuya_local/devices/sendo_airconditioner_c.yaml @@ -61,6 +61,13 @@ primary_entity: - dps_val: false value: "off" secondary_entities: + - entity: switch + name: Emergency heat + icon: "mdi:fire" + dps: + - id: 12 + type: boolean + name: switch - entity: light name: Backlight category: config diff --git a/custom_components/tuya_local/devices/smardeer_lock33.yaml b/custom_components/tuya_local/devices/smardeer_lock33.yaml new file mode 100644 index 00000000..8ee10603 --- /dev/null +++ b/custom_components/tuya_local/devices/smardeer_lock33.yaml @@ -0,0 +1,96 @@ +name: Door lock +products: + - id: oufbykkic2alxcjw + name: SmarDeer Lock33 +primary_entity: + entity: lock + dps: + - id: 1 + type: integer + name: unlock_fingerprint + optional: true + persist: false + - id: 2 + type: integer + name: unlock_password + optional: true + persist: false + - id: 3 + type: integer + name: unlock_temp_pwd + optional: true + persist: false + - id: 5 + type: integer + name: unlock_card + optional: true + persist: false + - id: 9 + type: integer + name: unlock_request + - id: 15 + name: unlock_app + type: integer + optional: true + persist: false + - id: 44 + name: unlock_multi + type: string + optional: true + persist: false + - id: 212 + name: push_message + type: string + optional: true +secondary_entities: + - entity: sensor + name: Error + category: diagnostic + dps: + - id: 8 + type: string + name: sensor + optional: true + - entity: sensor + class: battery + category: diagnostic + dps: + - id: 11 + type: string + name: sensor + unit: "%" + optional: true + mapping: + - dps_val: null + value_redirect: percent + - dps_val: poweroff + value: 0 + - dps_val: low + value: 30 + - dps_val: medium + value: 60 + - dps_val: high + value: 90 + - id: 12 + type: integer + name: percent + optional: true + - entity: binary_sensor + name: Hijack + class: safety + category: diagnostic + dps: + - id: 16 + type: boolean + name: sensor + optional: true + - entity: binary_sensor + name: Doorbell + class: sound + category: diagnostic + dps: + - id: 19 + type: boolean + name: sensor + optional: true + diff --git a/custom_components/tuya_local/devices/soleusair_air_purifier.yaml b/custom_components/tuya_local/devices/soleusair_air_purifier.yaml new file mode 100644 index 00000000..59ae9c11 --- /dev/null +++ b/custom_components/tuya_local/devices/soleusair_air_purifier.yaml @@ -0,0 +1,122 @@ +name: Air purifier +products: + - id: kik7qavg2baebtk9 + name: Soleusair KJ1000F A10 + - id: 5xrkvysk7z6xrjum + name: Soleusair KJ760F A02 +primary_entity: + entity: fan + translation_key: fan_with_presets + icon: "mdi:air-purifier" + dps: + - id: 1 + name: switch + type: boolean + - id: 101 + type: integer + name: speed + range: + min: 1 + max: 5 + mapping: + - scale: 0.05 + - id: 3 + name: preset_mode + type: string + mapping: + - dps_val: manual + value: normal + - dps_val: auto + value: smart + - dps_val: sleep + value: sleep + - dps_val: displayoff + value: displayoff +secondary_entities: + - entity: sensor + name: Filter life + category: diagnostic + icon: "mdi:timelapse" + dps: + - id: 5 + type: integer + name: sensor + unit: "%" + - entity: switch + name: Ionizer + icon: "mdi:creation" + category: config + dps: + - id: 6 + type: boolean + name: switch + - entity: lock + name: Child lock + category: config + dps: + - id: 7 + type: boolean + name: lock + mapping: + - dps_val: false + icon: "mdi:hand-back-right" + - dps_val: true + icon: "mdi:hand-back-right-off" + - entity: switch + name: UV sterilization + category: config + icon: "mdi:solar-power" + dps: + - id: 9 + type: boolean + name: switch + optional: true + - entity: sensor + class: temperature + dps: + - id: 12 + name: sensor + type: integer + unit: C + - entity: sensor + class: humidity + dps: + - id: 13 + type: integer + name: sensor + unit: "%" + - entity: sensor + class: volatile_organic_compounds_parts + dps: + - id: 14 + type: integer + name: sensor + optional: true + unit: ppb + - entity: sensor + name: Air quality + icon: "mdi:approximately-equal" + class: enum + dps: + - id: 21 + type: string + name: sensor + mapping: + - dps_val: great + value: great + - dps_val: good + value: good + - dps_val: medium + value: medium + - dps_val: severe + value: severe + - entity: sensor + name: Formaldehyde + icon: "mdi:chemical-weapon" + dps: + - id: 27 + type: integer + name: sensor + unit: ugm3 + mapping: + - scale: 0.1 diff --git a/custom_components/tuya_local/devices/tesla_humidifier.yaml b/custom_components/tuya_local/devices/tesla_humidifier.yaml new file mode 100644 index 00000000..4de8afec --- /dev/null +++ b/custom_components/tuya_local/devices/tesla_humidifier.yaml @@ -0,0 +1,65 @@ +name: Humidifier +products: + - id: noj5c7qq3znq8j6e + name: Tesla Smart humidifier +primary_entity: + entity: fan + name: Humidifier + icon: "mdi:sprinkler-variant" + dps: + - id: 1 + type: boolean + name: switch + - id: 23 + type: string + name: speed + mapping: + - dps_val: L + value: 33 + - dps_val: M + value: 67 + - dps_val: H + value: 100 +secondary_entities: + - entity: light + dps: + - id: 5 + type: boolean + name: switch + - entity: select + name: Timer + icon: "mdi:timer" + category: config + dps: + - id: 19 + type: string + name: option + mapping: + - dps_val: cancel + value: "Off" + - dps_val: "1h" + value: "1 hour" + - dps_val: "4h" + value: "4 hours" + - entity: sensor + name: Time remaining + class: duration + category: diagnostic + dps: + - id: 20 + type: integer + name: sensor + unit: min + class: measurement + - entity: binary_sensor + name: Fault + class: problem + category: diagnostic + dps: + - id: 22 + type: bitfield + name: sensor + mapping: + - dps_val: 0 + value: false + - value: true diff --git a/custom_components/tuya_local/devices/thermex_lima80v_waterheater.yaml b/custom_components/tuya_local/devices/thermex_lima80v_waterheater.yaml new file mode 100644 index 00000000..f3b68bc0 --- /dev/null +++ b/custom_components/tuya_local/devices/thermex_lima80v_waterheater.yaml @@ -0,0 +1,30 @@ +name: Water heater +primary_entity: + entity: water_heater + dps: + - id: 1 + type: boolean + name: operation_mode + mapping: + - dps_val: false + value: "off" + - dps_val: true + value: electric + - id: 9 + type: integer + name: temperature + range: + min: 35 + max: 75 + - id: 13 + type: string + name: work_mode # to observe for potential expansion of operation_mode + - id: 20 + type: integer + name: attr1 # maybe fault_code? + - id: 101 + name: away_mode + type: boolean + - id: 102 + type: integer + name: current_temperature diff --git a/custom_components/tuya_local/devices/valehaus_syzn119_tow_w.yaml b/custom_components/tuya_local/devices/valehaus_syzn119_tow_w.yaml new file mode 100644 index 00000000..28831b88 --- /dev/null +++ b/custom_components/tuya_local/devices/valehaus_syzn119_tow_w.yaml @@ -0,0 +1,79 @@ +name: Towel warmer +products: + - id: 1dxb14emvqzxzc5q + name: Valehaus SYZN119 + +primary_entity: + entity: climate + icon: "mdi:heating-coil" + dps: + - id: 1 + type: boolean + name: hvac_mode + mapping: + - dps_val: true + value: heat + - dps_val: false + value: "off" + - id: 2 + name: temperature + type: integer + range: + min: 35 + max: 60 + unit: C + mapping: + - step: 5 + - id: 3 + type: integer + name: current_temperature + - id: 14 + type: string + name: hvac_action + mapping: + - constraint: hvac_mode + conditions: + - dps_val: true + mapping: + - dps_val: heating + value: heating + - dps_val: standby + value: idle + - dps_val: false + value: "off" +secondary_entities: + - entity: select + name: Timer + icon: "mdi:timer" + category: config + dps: + - id: 12 + type: string + name: option + optional: true + mapping: + - dps_val: cancel + value: cancel + - dps_val: "1h" + value: "1h" + - dps_val: "2h" + value: "2h" + - dps_val: "3h" + value: "3h" + - dps_val: "4h" + value: "4h" + - dps_val: "5h" + value: "5h" + - dps_val: "6h" + value: "6h" + - entity: sensor + name: Time remaining + class: duration + dps: + - id: 13 + type: integer + name: sensor + unit: min + range: + min: 0 + max: 1440 diff --git a/custom_components/tuya_local/devices/vivax_heatpump.yaml b/custom_components/tuya_local/devices/vivax_heatpump.yaml index c42ce41f..6d4351f3 100644 --- a/custom_components/tuya_local/devices/vivax_heatpump.yaml +++ b/custom_components/tuya_local/devices/vivax_heatpump.yaml @@ -1,7 +1,7 @@ name: Heat pump products: - id: 9xvzf8c0bg33eenj - name: Vivax ACP-12CH35REWI + name: Vivax ACP-12CH35REWI / Tadiran Apollo - id: keycnvksyhjcrg8t name: Thermor Nagano HEWRQU1 primary_entity: @@ -104,37 +104,89 @@ primary_entity: # Undocumented but in log - id: 102 type: integer - name: unknown_102 + name: pm25 - id: 105 type: string - name: unknown_105 - - id: 106 - type: boolean - name: unknown_106 + name: air_quality - id: 107 type: boolean - name: unknown_107 + name: strong - id: 111 type: boolean - name: unknown_111 + name: new_style - id: 113 type: string - name: unknown_113 + name: sense - id: 114 type: boolean - name: unknown_114 + name: self_cleaning - id: 116 type: integer - name: unknown_116 + name: fault_code # next two look obviously swing (logged values ud_00 and lr_00), # but full mappings not available to map to swing mode + # from #1183, seems to be ud_00, ud_01, ud_02, ud_03, ud_04, ud_0c (last one is swing, others are pos) - id: 117 type: string - name: vertical_swing + name: swing_mode + mapping: + - dps_val: ud_0c + constraint: horizontal_swing + conditions: + - dps_val: lr_0c + value: both + - dps_val: lr_00 + value: vertical + - value: vertical + - dps_val: ud_00 + constraint: horizontal_swing + conditions: + - dps_val: lr_0c + value: horizontal + - dps_val: lr_00 + value: "off" + - value: "off" + - constraint: horizontal_swing + conditions: + - dps_val: lr_0c + value: horizontal + - value: "off" - id: 118 type: string name: horizontal_swing + # From Tadiran Apollo + - id: 101 + type: boolean + name: mood_lighting + optional: true + - id: 103 + type: integer + name: co2 + optional: true + - id: 104 + type: integer + name: volatile_organic_compounds + optional: true + - id: 110 + type: boolean + name: heating_10c + optional: true + - id: 112 + type: integer + name: power + optional: true + - id: 119 + type: boolean + name: cleaning_56c + optional: true secondary_entities: + - entity: switch + name: Emergency heat + icon: "mdi:fire" + dps: + - id: 12 + type: boolean + name: switch - entity: light name: Display icon: "mdi:numeric" @@ -164,5 +216,76 @@ secondary_entities: - id: 108 type: boolean name: switch - # Boolean dps 16 = Beep and 109 = Sleep documented but missing from log + - entity: switch + name: Sleep + category: config + icon: "mdi:power-sleep" + dps: + - id: 109 + type: boolean + name: switch + optional: true + - entity: switch + name: Health + category: config + icon: "mdi:shield-bug" + dps: + - id: 106 + type: boolean + name: switch + optional: true + - entity: select + name: Vertical swing + category: config + icon: "mdi:arrow-up-down-bold" + dps: + - id: 117 + type: string + name: option + mapping: + - dps_val: ud_00 + value: Top + - dps_val: ud_01 + value: Upper + - dps_val: ud_02 + value: Middle + - dps_val: ud_03 + value: Lower + - dps_val: ud_04 + value: Bottom + - dps_val: ud_0c + value: Swing + - entity: select + name: Horizontal swing + category: config + icon: "mdi:arrow-up-down-bold" + dps: + - id: 117 + type: string + name: option + mapping: + - dps_val: lr_00 + value: Leftmost + - dps_val: lr_01 + value: Left + - dps_val: lr_02 + value: Middle + - dps_val: lr_03 + value: Right + - dps_val: lr_04 + value: Rightmost + - dps_val: lr_0c + value: Swing + - entity: binary_sensor + name: Fault + class: problem + category: diagnostic + dps: + - id: 116 + type: bitfield + name: sensor + mapping: + - dps_val: 0 + value: false + - value: true diff --git a/custom_components/tuya_local/devices/zm_wifi_smartmeter.yaml b/custom_components/tuya_local/devices/zm_wifi_smartmeter.yaml new file mode 100644 index 00000000..4be2c57f --- /dev/null +++ b/custom_components/tuya_local/devices/zm_wifi_smartmeter.yaml @@ -0,0 +1,82 @@ +name: Energy meter +products: + - id: nzexeqam9qulajbf + name: ZM-wi-Fi +primary_entity: + entity: sensor + class: energy + dps: + - id: 1 + type: integer + name: sensor + unit: kWh + class: total_increasing + mapping: + - scale: 100 + - id: 10 + name: fault_code + type: bitfield + - id: 17 + name: alarm_setting + type: string + - id: 18 + name: meter_id + type: string +secondary_entities: + - entity: sensor + class: voltage + category: diagnostic + dps: + - id: 6 + type: base64 + name: sensor + optional: true + unit: V + class: measurement + mapping: + - mask: "FFFF000000000000" + scale: 10 + - entity: sensor + class: current + category: diagnostic + dps: + - id: 6 + type: base64 + name: sensor + optional: true + unit: A + class: measurement + mapping: + - mask: "0000FFFFFF000000" + scale: 1000 + - entity: sensor + class: power + category: diagnostic + dps: + - id: 6 + type: base64 + name: sensor + optional: true + unit: kW + class: measurement + mapping: + - mask: "0000000000FFFFFF" + scale: 1000 + - entity: binary_sensor + name: Fault + class: problem + category: diagnostic + dps: + - id: 10 + type: bitfield + name: sensor + mapping: + - dps_val: 0 + value: false + - value: true + - entity: switch + dps: + - id: 16 + type: boolean + name: switch + diff --git a/custom_components/tuya_local/devices/zx_db11b_doorbell_alarm.yaml b/custom_components/tuya_local/devices/zx_db11b_doorbell_alarm.yaml new file mode 100644 index 00000000..851fd65b --- /dev/null +++ b/custom_components/tuya_local/devices/zx_db11b_doorbell_alarm.yaml @@ -0,0 +1,335 @@ +name: Doorbell +products: + - id: 4kfqpaat5buefsv0 + name: Alarm Hub with Melodies Pro +primary_entity: + entity: binary_sensor + name: Alarm + class: sound + category: diagnostic + dps: + - id: 32 + type: string + name: sensor + mapping: + - dps_val: normal + value: false + - dps_val: alarm + value: true + - id: 24 + type: string + name: mode_state + - id: 36 + type: string + name: sub_class + - id: 37 + type: string + name: sub_type + - id: 39 + type: string + name: sub_state + - id: 40 + type: string + name: master_language +secondary_entities: + - entity: alarm_control_panel + name: Alarm + dps: + - id: 1 + type: string + name: alarm_state + mapping: + - dps_val: disarmed + value: disarmed + - dps_val: arm + value: armed_away + - dps_val: home + value: armed_home + - dps_val: sos + value: triggered + - entity: number + name: Exit delay + category: config + icon: "mdi:timer-lock" + dps: + - id: 2 + type: integer + name: value + unit: s + range: + min: 0 + max: 300 + - entity: siren + name: Alarm + dps: + - id: 3 + type: integer + name: duration + unit: min + range: + min: 1 + max: 60 + - id: 8 + type: string + name: tone + mapping: + - dps_val: "1" + value: Slow + - dps_val: "2" + value: Fast + - dps_val: "3" + value: Westminster quarters + - dps_val: "4" + value: Für Elise + - dps_val: "5" + value: Bird + - dps_val: "6" + value: Rooster + - dps_val: "7" + value: Phone + - dps_val: "8" + value: Wolf + - dps_val: "9" + value: Moonglow + - dps_val: "10" + value: Cannon + - dps_val: "11" + value: Yesterday once more + - dps_val: "12" + value: Cuckoo clock + - dps_val: "13" + value: Cuckoo waltz + - dps_val: "14" + value: Class ringtone + - dps_val: "15" + value: Everything is better + - dps_val: "16" + value: Dreamtable - The dawn + - dps_val: "17" + value: Turkish march + - dps_val: "18" + value: Alarm + - dps_val: "19" + value: The great mercy mantra + - dps_val: "20" + value: Overture 1812 + - dps_val: "21" + value: The moon reflected in Er-quan + - dps_val: "22" + value: Little star + - dps_val: "23" + value: Waltz of the flowers + - dps_val: "24" + value: Libiamo ne lieti calici + - dps_val: "25" + value: Die Forelle + - dps_val: "26" + value: Circus + - dps_val: "27" + value: Danse des petit cygnes + - dps_val: "28" + value: Fiddler on the roof + - dps_val: "29" + value: Beautiful dreamer + - dps_val: "30" + value: Carmen overture + - dps_val: "31" + value: The fishermen - Evening song + - dps_val: "32" + value: Dog + - dps_val: "33" + value: Zhu Bajie + - dps_val: "34" + value: Paris in autumn + - dps_val: "35" + value: Nutcracker waltz + - dps_val: "36" + value: Red river valley + - dps_val: "37" + value: The four seasons + - dps_val: "38" + value: Schubert Serenade + - dps_val: "39" + value: Merry Christmas + - dps_val: "40" + value: Malta + - dps_val: "41" + value: Toy soldier + - dps_val: "42" + value: Ode an die Freude + - dps_val: "43" + value: Ievan Polkka + - dps_val: "44" + value: Rondo a capriccio + - dps_val: "45" + value: Hungarian dance + - dps_val: "46" + value: Minuet in G-major + - dps_val: "47" + value: Auld lang syne + - dps_val: "48" + value: The nutcracker + - dps_val: "49" + value: Pop dance + - dps_val: "50" + value: Toreador song + - dps_val: "51" + value: Lullaby + - dps_val: "52" + value: Greensleeves + - dps_val: "53" + value: Happy new year + - dps_val: "54" + value: The wandering songstress + - dps_val: "55" + value: Chopin Waltz + - dps_val: "56" + value: Shepherd song + - dps_val: "57" + value: Happy birthday + - dps_val: "58" + value: A hulusi flute + - entity: switch + name: Alarm sound + icon: "mdi:bullhorn" + category: config + dps: + - id: 4 + type: boolean + name: switch + - entity: switch + name: Alarm light + icon: "mdi:alarm-light" + category: config + dps: + - id: 6 + type: boolean + name: switch + - entity: light + name: Status indicator + icon: "mdi:led-on" + category: config + dps: + - id: 11 + type: boolean + name: switch + - entity: switch + name: Door notify + icon: "mdi:door-closed" + category: config + dps: + - id: 12 + type: boolean + name: switch + - entity: switch + name: Open notify + icon: "mdi:door-open" + category: config + dps: + - id: 13 + type: boolean + name: switch + - entity: binary_sensor + name: Mains power + class: power + category: diagnostic + dps: + - id: 15 + type: boolean + name: sensor + - entity: sensor + class: battery + category: diagnostic + dps: + - id: 16 + type: integer + name: sensor + unit: "%" + class: measurement + - entity: binary_sensor + class: battery + category: diagnostic + dps: + - id: 17 + type: boolean + name: sensor + mapping: + - dps_val: true + value: false + - dps_val: false + value: true + - entity: binary_sensor + name: Ringing + class: sound + category: diagnostic + dps: + - id: 26 + type: boolean + name: sensor + optional: true + persist: false + mapping: + - dps_val: null + value: false + - value: true + - entity: switch + name: Doorbell notify + icon: "mdi:bell-badge" + category: config + dps: + - id: 27 + type: boolean + name: switch + - entity: number + name: Entry delay + category: config + icon: "mdi:timer-lock-open" + dps: + - id: 28 + type: integer + name: value + unit: s + range: + min: 0 + max: 300 + - entity: switch + name: Tick countdown + icon: "mdi:metronome" + category: config + dps: + - id: 29 + type: boolean + name: switch + - entity: number + name: Doorbell volume + category: config + dps: + - id: 30 + type: string + name: value + unit: "%" + mapping: + - dps_val: high + value: 100 + icon: "mdi:volume-high" + - dps_val: upper-middle + value: 75 + icon: "mdi:volume-medium" + - dps_val: lower-middle + value: 50 + icon: "mdi:volume-medium" + - dps_val: low + value: 25 + icon: "mdi:volume-low" + - dps_val: mute + value: 0 + icon: "mdi:volume-mute" + - entity: button + name: Factory reset + class: restart + category: config + dps: + - id: 34 + type: boolean + name: button + diff --git a/custom_components/tuya_local/devices/zym201_presence_sensor.yaml b/custom_components/tuya_local/devices/zym201_presence_sensor.yaml index bbcb1211..f5a37b70 100644 --- a/custom_components/tuya_local/devices/zym201_presence_sensor.yaml +++ b/custom_components/tuya_local/devices/zym201_presence_sensor.yaml @@ -58,7 +58,7 @@ secondary_entities: max: 550 mapping: - scale: 100 - step: 100 +# step: 100 - entity: sensor name: Target distance class: distance diff --git a/custom_components/tuya_local/helpers/device_config.py b/custom_components/tuya_local/helpers/device_config.py index 0d914e91..245d6ee2 100644 --- a/custom_components/tuya_local/helpers/device_config.py +++ b/custom_components/tuya_local/helpers/device_config.py @@ -18,22 +18,22 @@ _LOGGER = logging.getLogger(__name__) -def _typematch(type, value): +def _typematch(vtype, value): # Workaround annoying legacy of bool being a subclass of int in Python - if type is int and isinstance(value, bool): + if vtype is int and isinstance(value, bool): return False # Allow integers to pass as floats. - if type is float and isinstance(value, Number): + if vtype is float and isinstance(value, Number): return True - if isinstance(value, type): + if isinstance(value, vtype): return True # Allow values embedded in strings if they can be converted # But not for bool, as everything can be converted to bool - elif isinstance(value, str) and type is not bool: + elif isinstance(value, str) and vtype is not bool: try: - type(value) + vtype(value) return True except ValueError: return False @@ -74,7 +74,7 @@ def _bytes_to_fmt(bytes, signed=False): def _equal_or_in(value1, values2): """Return true if value1 is the same as values2, or appears in values2.""" - if type(values2) is not str and isinstance(values2, Sequence): + if not isinstance(values2, str) and isinstance(values2, Sequence): return value1 in values2 else: return value1 == values2 @@ -844,7 +844,7 @@ def get_values_to_set(self, device, value): if cval == value: c_dps = self._entity.find_dps(mapping.get("constraint", self.name)) cond_dpsval = cond.get("dps_val") - single_match = type(cond_dpsval) == str or ( + single_match = isinstance(cond_dpsval, str) or ( not isinstance(cond_dpsval, Sequence) ) if c_dps.id != self.id and single_match: diff --git a/custom_components/tuya_local/lock.py b/custom_components/tuya_local/lock.py index fd0797c9..f8623e24 100644 --- a/custom_components/tuya_local/lock.py +++ b/custom_components/tuya_local/lock.py @@ -43,6 +43,7 @@ def __init__(self, device: TuyaLocalDevice, config: TuyaEntityConfig): self._unlock_key_dp = dps_map.pop("unlock_key", None) self._unlock_ble_dp = dps_map.pop("unlock_ble", None) self._unlock_voice_dp = dps_map.pop("unlock_voice", None) + self._unlock_multi_dp = dps_map.pop("unlock_multi", None) self._req_unlock_dp = dps_map.pop("request_unlock", None) self._approve_unlock_dp = dps_map.pop("approve_unlock", None) self._req_intercom_dp = dps_map.pop("request_intercom", None) @@ -68,6 +69,7 @@ def is_locked(self): self._unlock_key_dp, self._unlock_ble_dp, self._unlock_voice_dp, + self._unlock_multi_dp, ): if d: if d.get_value(self._device): @@ -103,6 +105,7 @@ def changed_by(self): self._unlock_pw_dp: "Password", self._unlock_tmppw_dp: "Temporary Password", self._unlock_voice_dp: "Voice", + self._unlock_multi_dp: "Multifactor", }.items(): by = self.unlocker_id(dp, desc) if by: diff --git a/custom_components/tuya_local/manifest.json b/custom_components/tuya_local/manifest.json index b0fe7a2d..816ea84a 100644 --- a/custom_components/tuya_local/manifest.json +++ b/custom_components/tuya_local/manifest.json @@ -1,13 +1,13 @@ -{ - "domain": "tuya_local", - "name": "Tuya Local", - "codeowners": ["@make-all"], - "config_flow": true, - "dependencies": [], - "documentation": "https://github.com/make-all/tuya-local", - "integration_type": "device", - "iot_class": "local_push", - "issue_tracker": "https://github.com/make-all/tuya-local/issues", - "requirements": ["pycryptodome~=3.18","tinytuya==1.12.11"], - "version": "2023.11.0" -} +{ + "domain": "tuya_local", + "name": "Tuya Local", + "codeowners": ["@make-all"], + "config_flow": true, + "dependencies": [], + "documentation": "https://github.com/make-all/tuya-local", + "integration_type": "device", + "iot_class": "local_push", + "issue_tracker": "https://github.com/make-all/tuya-local/issues", + "requirements": ["tinytuya==1.13.1"], + "version": "2023.12.0" +}