Parcourir la source

Herschel XLS T-MT Thermostat integration (#3736)

* Herschel XLS T-MT Thermostat integration

* Update herschel_t_mt_thermostat.yaml

* fix (herschel_t_mt_thermostat): fix test failure, and other changes

- move constraint inside mapping
- assume when set to F step is 10 (1F), as this is usual for 0.5C increments.
- uncomment temperature_unit so it can be referenced from the conditions, add also a select entity for it.

PR #3736

* fix (herschel_t_mt_thermostat): fix indentation

PR #3736

* fix (herschel_t_mt_thermostat): translation_key does not belong in mappings

HA only defines translation keys at entity level. Option values are then expected to correspond to the sub keys directly, there is no separate key and default value (default is the key itself).

PR #3736

---------

Co-authored-by: Jason Rumney <make-all@users.noreply.github.com>
Richard Lincoln il y a 4 mois
Parent
commit
d1f0a16a70
1 fichiers modifiés avec 134 ajouts et 0 suppressions
  1. 134 0
      custom_components/tuya_local/devices/herschel_t_mt_thermostat.yaml

+ 134 - 0
custom_components/tuya_local/devices/herschel_t_mt_thermostat.yaml

@@ -0,0 +1,134 @@
+name: Thermostat
+products:
+  - id: ma3oamwzywooctul
+    manufacturer: Herschel
+    model: T-MT Mains powered Wifi thermostat
+entities:
+  - entity: climate
+    translation_only_key: thermostat
+    dps:
+      - id: 1
+        name: hvac_mode
+        type: boolean
+        mapping:
+          - dps_val: true
+            value: heat
+          - dps_val: false
+            value: "off"
+      - id: 2
+        name: temperature
+        type: integer
+        range:
+          min: 160
+          max: 1040
+        mapping:
+          - scale: 10
+            step: 5
+            constraint: temperature_unit
+            conditions:
+              - dps_val: c
+                range:
+                  min: 160
+                  max: 300
+              - dps_val: f
+                step: 10
+                range:
+                  min: 410
+                  max: 1040
+      - id: 3
+        name: current_temperature
+        type: integer
+        mapping:
+          - scale: 10
+      - id: 104
+        name: temperature_unit
+        type: string
+        optional: true
+        mapping:
+          - dps_val: f
+            value: F
+          - value: C
+      - id: 111
+        name: hvac_action
+        type: boolean
+        mapping:
+          - dps_val: true
+            value: heating
+          - dps_val: false
+            value: "off"
+      - id: 4
+        name: preset_mode
+        type: string
+        mapping:
+          - dps_val: manual
+            value: manual
+          - dps_val: holiday
+            value: away
+          - dps_val: auto
+            value: program
+
+  - entity: lock
+    translation_key: child_lock
+    category: config
+    dps:
+      - id: 6
+        name: lock
+        type: boolean
+
+  - entity: number
+    name: Holiday length
+    category: config
+    class: duration
+    dps:
+      - id: 101
+        name: value
+        type: integer
+        unit: d
+        range:
+          min: 0
+          max: 99
+
+  - entity: switch
+    name: Open window detection
+    category: config
+    icon: "mdi:window-open"
+    dps:
+      - id: 103
+        name: switch
+        type: boolean
+
+  - entity: select
+    translation_key: temperature_unit
+    category: config
+    dps:
+      - id: 104
+        type: string
+        optional: true
+        name: option
+        mapping:
+          - dps_val: c
+            value: celsius
+          - dps_val: f
+            value: fahrenheit
+
+  - entity: number
+    name: Temperature calibration
+    category: config
+    dps:
+      - id: 106
+        name: value
+        type: integer
+        unit: °
+        range:
+          min: -90
+          max: 90
+        mapping:
+          - scale: 10
+
+  - entity: switch
+    name: Adaptive start
+    category: config
+    dps:
+      - id: 107
+        name: switch
+        type: boolean