From 82db311ed791e9f098abcba425deee2f6f5b719a Mon Sep 17 00:00:00 2001 From: Pavel Janouskovec Date: Mon, 9 Dec 2024 22:42:58 +0100 Subject: [PATCH 1/8] New device ezaiot_r9lite_thermostat.yaml Electric heating thermostat 16A version https://www.aliexpress.com/item/1005006020556081.html --- .../devices/ezaiot_r9lite_thermostat.yaml | 219 ++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml diff --git a/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml b/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml new file mode 100644 index 0000000000..324c2a51c2 --- /dev/null +++ b/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml @@ -0,0 +1,219 @@ +name: EZAIOT R9Lite thermostat +#https://www.aliexpress.com/item/1005006020556081.html Electric Heating 16A version +products: + - id: dq6nlukkifyawj9n + name: EZAIOT R9Lite thermostat +primary_entity: + entity: climate + dps: + - id: 1 + type: boolean + name: hvac_mode + mapping: + - dps_val: false + value: 'off' + - dps_val: true + constraint: mode + conditions: + - dps_val: auto + value: auto + - dps_val: manual + value: heat + - id: 2 + type: string + name: mode + hidden: true + - id: 16 + type: integer + name: temperature + range: + min: 50 + max: 10000 + mapping: + - scale: 10 + step: 5 + constraint: temperature_unit + conditions: + - dps_val: f + step: 10 + - id: 19 + type: integer + name: max_temperature + mapping: + - scale: 10 + - id: 23 + type: string + name: temperature_unit + mapping: + - dps_val: c + value: C + - dps_val: f + value: F + - id: 24 + type: integer + name: current_temperature + mapping: + - scale: 10 + - id: 26 + type: integer + name: min_temperature + mapping: + - scale: 10 + - id: 101 + type: integer + name: unknown_101 + - id: 112 + type: integer + name: unknown_112 + - id: 102 + type: integer + name: Temperature adjust step + - id: 110 + type: boolean + name: Valve state boolean + - id: 105 + type: string + name: Device name + - id: 108 + type: integer + name: Temperature calibration step +secondary_entities: + - entity: switch + translation_key: anti_frost + category: config + dps: + - id: 10 + type: boolean + name: switch + - entity: select + translation_key: temperature_unit + category: config + dps: + - id: 23 + type: string + name: option + mapping: + - dps_val: c + value: celsius + - dps_val: f + value: fahrenheit + - entity: select + name: Schedule + category: config + icon: 'mdi:calendar-clock' + dps: + - id: 31 + type: string + name: option + mapping: + - dps_val: '5_2' + value: Weekday+Weekend + - dps_val: '6_1' + value: Mon-Sat+Sun + - dps_val: '7' + value: Daily + - entity: binary_sensor + name: Valve + class: opening + category: diagnostic + dps: + - id: 36 + type: string + name: sensor + mapping: + - dps_val: open + value: true + - dps_val: close + value: false + - entity: lock + translation_key: child_lock + category: config + dps: + - id: 40 + type: boolean + name: lock + - entity: binary_sensor + category: diagnostic + class: problem + dps: + - id: 45 + type: bitfield + name: sensor + mapping: + - dps_val: 0 + value: false + - value: true + - id: 45 + type: bitfield + name: fault_code + - entity: number + name: High temperature limit + category: config + class: temperature + dps: + - id: 19 + type: integer + name: value + unit: C + range: + min: 50 + max: 10000 + mapping: + - scale: 10 + step: 10 + - entity: number + name: Low temperature limit + category: config + class: temperature + dps: + - id: 26 + name: value + type: integer + unit: C + range: + min: 50 + max: 10000 + mapping: + - scale: 10 + step: 10 + - entity: number + name: Temperature calibration + category: config + class: temperature + dps: + - id: 109 + name: value + type: integer + unit: C + range: + min: -99 + max: 99 + mapping: + - scale: 10 + step: 1 + - entity: sensor + #The dps id 113 is readonly (set not working)- I don't know why..probably not implemented on device + name: Temperature sensor type + category: diagnostic + dps: + - id: 113 + type: string + name: sensor + - entity: sensor + name: External sensor current temperature + class: temperature + category: diagnostic + dps: + - id: 115 + name: sensor + type: integer + unit: C + mapping: + - scale: 10 + - entity: sensor + name: Version + category: diagnostic + dps: + - id: 111 + name: sensor + type: string From e91af86f5740fcefd56f9b4944986fcbb002f2df Mon Sep 17 00:00:00 2001 From: Pavel Janouskovec Date: Mon, 16 Dec 2024 23:33:13 +0100 Subject: [PATCH 2/8] Update ezaiot_r9lite_thermostat.yaml --- .../devices/ezaiot_r9lite_thermostat.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml b/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml index 324c2a51c2..42401085fb 100644 --- a/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml +++ b/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml @@ -1,4 +1,4 @@ -name: EZAIOT R9Lite thermostat +name: Thermostat #https://www.aliexpress.com/item/1005006020556081.html Electric Heating 16A version products: - id: dq6nlukkifyawj9n @@ -28,7 +28,7 @@ primary_entity: name: temperature range: min: 50 - max: 10000 + max: 500 mapping: - scale: 10 step: 5 @@ -67,7 +67,7 @@ primary_entity: name: unknown_112 - id: 102 type: integer - name: Temperature adjust step + name: temperature_adjust_step - id: 110 type: boolean name: Valve state boolean @@ -147,7 +147,7 @@ secondary_entities: type: bitfield name: fault_code - entity: number - name: High temperature limit + name: Maximum temperature category: config class: temperature dps: @@ -162,7 +162,7 @@ secondary_entities: - scale: 10 step: 10 - entity: number - name: Low temperature limit + name: Minimum temperature category: config class: temperature dps: @@ -189,8 +189,7 @@ secondary_entities: min: -99 max: 99 mapping: - - scale: 10 - step: 1 + - scale: 10 - entity: sensor #The dps id 113 is readonly (set not working)- I don't know why..probably not implemented on device name: Temperature sensor type From 85bbe0225da4373412177c1d5eb6dd72f41ced25 Mon Sep 17 00:00:00 2001 From: Pavel Janouskovec Date: Mon, 16 Dec 2024 23:48:38 +0100 Subject: [PATCH 3/8] Update ezaiot_r9lite_thermostat.yaml External sensor current temperature -> External temperature --- .../tuya_local/devices/ezaiot_r9lite_thermostat.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml b/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml index 42401085fb..719aa63d16 100644 --- a/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml +++ b/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml @@ -199,7 +199,7 @@ secondary_entities: type: string name: sensor - entity: sensor - name: External sensor current temperature + name: External temperature class: temperature category: diagnostic dps: From ff8bc4ce7bab010df3f9ef24f25c701c5fbc181b Mon Sep 17 00:00:00 2001 From: Pavel Janouskovec Date: Tue, 17 Dec 2024 00:09:39 +0100 Subject: [PATCH 4/8] Update ezaiot_r9lite_thermostat.yaml hvac_action --- .../tuya_local/devices/ezaiot_r9lite_thermostat.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml b/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml index 719aa63d16..e30454c839 100644 --- a/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml +++ b/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml @@ -70,13 +70,18 @@ primary_entity: name: temperature_adjust_step - id: 110 type: boolean - name: Valve state boolean + name: hvac_action + mapping: + - dps_val: false + value: 'idle' + - dps_val: true + value: 'heating' - id: 105 type: string - name: Device name + name: device_name - id: 108 type: integer - name: Temperature calibration step + name: temperature_calibration_step secondary_entities: - entity: switch translation_key: anti_frost From 3cf2d019f6d9b964a3a553a4271c566c746ec14f Mon Sep 17 00:00:00 2001 From: Pavel Janouskovec Date: Tue, 17 Dec 2024 00:30:36 +0100 Subject: [PATCH 5/8] Update ezaiot_r9lite_thermostat.yaml temperature_sensor_type and version as climate attribute instead of sensor --- .../devices/ezaiot_r9lite_thermostat.yaml | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml b/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml index e30454c839..123ab33cdf 100644 --- a/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml +++ b/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml @@ -82,6 +82,13 @@ primary_entity: - id: 108 type: integer name: temperature_calibration_step + - id: 111 + type: string + name: version + - id: 113 + #The dps id 113 is readonly (set not working)- I don't know why..probably not implemented on device + type: string + name: temperature_sensor_type secondary_entities: - entity: switch translation_key: anti_frost @@ -195,14 +202,6 @@ secondary_entities: max: 99 mapping: - scale: 10 - - entity: sensor - #The dps id 113 is readonly (set not working)- I don't know why..probably not implemented on device - name: Temperature sensor type - category: diagnostic - dps: - - id: 113 - type: string - name: sensor - entity: sensor name: External temperature class: temperature @@ -214,10 +213,3 @@ secondary_entities: unit: C mapping: - scale: 10 - - entity: sensor - name: Version - category: diagnostic - dps: - - id: 111 - name: sensor - type: string From 1aaad940762c6e28c690c633e04ae04ae2be06c5 Mon Sep 17 00:00:00 2001 From: Pavel Janouskovec Date: Tue, 17 Dec 2024 01:28:40 +0100 Subject: [PATCH 6/8] Update ezaiot_r9lite_thermostat.yaml Dps id 36 (valve state text represenation) is redundant with dps id 110 (valve state- boolean representation) so I removed sensor for dps id 36 and create as climate attribute and mark the attribute as hidden. --- .../devices/ezaiot_r9lite_thermostat.yaml | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml b/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml index 123ab33cdf..70afc70cf9 100644 --- a/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml +++ b/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml @@ -62,9 +62,16 @@ primary_entity: - id: 101 type: integer name: unknown_101 + hidden: true + - id: 36 + # dps id 36 (valve state) is redundant with dps id 110 + type: string + name: Valve state (text representation open/close) + hidden: true - id: 112 type: integer name: unknown_112 + hidden: true - id: 102 type: integer name: temperature_adjust_step @@ -86,7 +93,7 @@ primary_entity: type: string name: version - id: 113 - #The dps id 113 is readonly (set not working)- I don't know why..probably not implemented on device + # The dps id 113 is readonly (set not working)- I don't know why..probably not implemented on device type: string name: temperature_sensor_type secondary_entities: @@ -124,19 +131,6 @@ secondary_entities: value: Mon-Sat+Sun - dps_val: '7' value: Daily - - entity: binary_sensor - name: Valve - class: opening - category: diagnostic - dps: - - id: 36 - type: string - name: sensor - mapping: - - dps_val: open - value: true - - dps_val: close - value: false - entity: lock translation_key: child_lock category: config From 66e4f784bf54d240a82e617b5a77087bc25d8d1b Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Tue, 17 Dec 2024 18:22:00 +0900 Subject: [PATCH 7/8] EzaIoT R9lite: lint fixes PR #2631 --- .../tuya_local/devices/ezaiot_r9lite_thermostat.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml b/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml index 70afc70cf9..e032bd7507 100644 --- a/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml +++ b/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml @@ -1,5 +1,6 @@ name: Thermostat -#https://www.aliexpress.com/item/1005006020556081.html Electric Heating 16A version +# https://www.aliexpress.com/item/1005006020556081.html +# Electric Heating 16A version products: - id: dq6nlukkifyawj9n name: EZAIOT R9Lite thermostat @@ -93,9 +94,9 @@ primary_entity: type: string name: version - id: 113 - # The dps id 113 is readonly (set not working)- I don't know why..probably not implemented on device + # The dps id 113 is readonly..probably not implemented on device type: string - name: temperature_sensor_type + name: temperature_sensor_type secondary_entities: - entity: switch translation_key: anti_frost @@ -195,7 +196,7 @@ secondary_entities: min: -99 max: 99 mapping: - - scale: 10 + - scale: 10 - entity: sensor name: External temperature class: temperature From cf6147fc3af2baa18c1d417a1357236bbf5379b4 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Tue, 17 Dec 2024 18:30:38 +0900 Subject: [PATCH 8/8] EzaIoT R9Lite: naming and syntax tweaks - use only alphanumeric and underscore in attribute names - standardize on double quotes where needed on strings - remove some unneeded quoting PR #2651 --- .../devices/ezaiot_r9lite_thermostat.yaml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml b/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml index e032bd7507..37472508f9 100644 --- a/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml +++ b/custom_components/tuya_local/devices/ezaiot_r9lite_thermostat.yaml @@ -12,7 +12,7 @@ primary_entity: name: hvac_mode mapping: - dps_val: false - value: 'off' + value: "off" - dps_val: true constraint: mode conditions: @@ -63,16 +63,13 @@ primary_entity: - id: 101 type: integer name: unknown_101 - hidden: true - id: 36 # dps id 36 (valve state) is redundant with dps id 110 type: string - name: Valve state (text representation open/close) - hidden: true + name: valve_state - id: 112 type: integer name: unknown_112 - hidden: true - id: 102 type: integer name: temperature_adjust_step @@ -81,9 +78,9 @@ primary_entity: name: hvac_action mapping: - dps_val: false - value: 'idle' + value: idle - dps_val: true - value: 'heating' + value: heating - id: 105 type: string name: device_name @@ -120,17 +117,17 @@ secondary_entities: - entity: select name: Schedule category: config - icon: 'mdi:calendar-clock' + icon: "mdi:calendar-clock" dps: - id: 31 type: string name: option mapping: - - dps_val: '5_2' + - dps_val: "5_2" value: Weekday+Weekend - - dps_val: '6_1' + - dps_val: "6_1" value: Mon-Sat+Sun - - dps_val: '7' + - dps_val: "7" value: Daily - entity: lock translation_key: child_lock