Parcourir la source

Avatto ME81: merge into identical Beok TGR81 config

- Beok was created first, and was already modified to support a
  different Avatto model. The Avatto did not match at the time because
  it required more dps to be marked optional.
Jason Rumney il y a 1 an
Parent
commit
7978a8ee8a

+ 0 - 194
custom_components/tuya_local/devices/avatto_me81_thermostat.yaml

@@ -1,194 +0,0 @@
-name: Thermostat
-products:
-  - id: gogb05wrtredz3bs
-    name: Avatto ME81
-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
-      unit: C
-      range:
-        min: 5
-        max: 90
-    - id: 19
-      type: integer
-      name: max_temperature
-      optional: true
-    - id: 26
-      type: integer
-      name: min_temperature
-      optional: true
-    - id: 24
-      type: integer
-      name: current_temperature
-      mapping:
-        - scale: 10
-    - id: 36
-      type: string
-      name: hvac_action
-      mapping:
-        - dps_val: open
-          value: heating
-        - dps_val: close
-          value: idle
-    - id: 38
-      type: string
-      optional: true
-      name: week_program
-secondary_entities:
-  - entity: switch
-    translation_key: anti_frost
-    category: config
-    dps:
-      - id: 10
-        type: boolean
-        name: switch
-        optional: true
-        mapping:
-          - dps_val: null
-            value: false
-            hidden: true
-  - entity: number
-    name: Maximum temperature
-    class: temperature
-    category: config
-    icon: "mdi:thermometer-chevron-up"
-    dps:
-      - id: 19
-        type: integer
-        name: value
-        optional: true
-        unit: C
-        range:
-          min: 30
-          max: 90
-  - entity: number
-    name: Minimum temperature
-    class: temperature
-    category: config
-    icon: "mdi:thermometer-chevron-down"
-    dps:
-      - id: 26
-        type: integer
-        name: value
-        optional: true
-        unit: C
-        range:
-          min: 5
-          max: 20
-  - entity: number
-    name: Temperature calibration
-    category: config
-    icon: "mdi:thermometer-check"
-    dps:
-      - id: 27
-        type: integer
-        optional: true
-        name: value
-        unit: °
-        range:
-          min: -9
-          max: 9
-  - entity: button
-    translation_key: factory_reset
-    category: config
-    dps:
-      - id: 39
-        type: boolean
-        name: button
-        optional: true
-  - entity: lock
-    translation_key: child_lock
-    category: config
-    dps:
-      - id: 40
-        type: boolean
-        name: lock
-        optional: true
-        mapping:
-          - dps_val: null
-            value: false
-            hidden: true
-  - entity: select
-    name: Temperature sensor
-    icon: "mdi:home-thermometer"
-    category: config
-    dps:
-      - id: 43
-        type: string
-        optional: true
-        name: option
-        mapping:
-          - dps_val: in
-            value: Internal
-          - dps_val: out
-            value: External
-          - dps_val: all
-            value: Both
-          - dps_val: null
-            value: Internal
-            hidden: true
-  - entity: binary_sensor
-    class: problem
-    category: diagnostic
-    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: Temperature hysteresis
-    category: config
-    icon: "mdi:thermometer-plus"
-    dps:
-      - id: 101
-        type: integer
-        optional: true
-        name: value
-        unit: °
-        range:
-          min: 1
-          max: 5
-  - entity: select
-    name: Program type
-    icon: "mdi:calendar-week"
-    category: config
-    dps:
-      - id: 102
-        type: string
-        optional: true
-        name: option
-        mapping:
-          - dps_val: "00"
-            value: Disabled
-          - dps_val: "52"
-            value: Weekdays+Weekend
-          - dps_val: "61"
-            value: Six working days
-          - dps_val: "70"
-            value: Daily

+ 24 - 11
custom_components/tuya_local/devices/beok_tgr81_thermostat_c.yaml

@@ -1,7 +1,10 @@
 name: Beok TGR81 thermostat
+legacy_type: avatto_me81_thermostat
 products:
   - id: gw173aldekvpzalg
     name: Avatto WT200W-EH
+  - id: gogb05wrtredz3bs
+    name: Avatto ME81  
 primary_entity:
   entity: climate
   translation_only_key: thermostat
@@ -11,10 +14,17 @@ primary_entity:
       type: boolean
       mapping:
         - dps_val: true
-          value: heat
+          constraint: preset_mode
+          conditions:
+            - dps_val: auto
+              value: auto
+            - dps_val: manual
+              value: heat
         - dps_val: false
           value: "off"
     - id: 2
+      # Deprecated: use hvac_mode to select between these
+      # left as preset_mode for now to avoid breaking things
       name: preset_mode
       type: string
       mapping:
@@ -53,12 +63,13 @@ primary_entity:
           value: heating
 secondary_entities:
   - entity: number
-    name: Calibration offset
+    name: Temperature calibration
     category: config
-    icon: "mdi:thermometer"
+    icon: "mdi:thermometer-check"
     dps:
       - id: 27
         type: integer
+        optional: true
         name: value
         unit: C
         range:
@@ -70,7 +81,12 @@ secondary_entities:
     dps:
       - id: 10
         type: boolean
+        optional: true
         name: switch
+        mapping:
+          - dps_val: null
+            value: false
+            hidden: true
   - entity: lock
     translation_key: child_lock
     category: config
@@ -81,6 +97,7 @@ secondary_entities:
         name: lock
   - entity: select
     name: Sensor selection
+    icon: "mdi:home-thermometer"
     category: config
     dps:
       - id: 43
@@ -89,13 +106,10 @@ secondary_entities:
         optional: true
         mapping:
           - dps_val: in
-            icon: "mdi:gauge"
             value: Internal
           - dps_val: out
-            icon: "mdi:thermometer-chevron-down"
             value: External
           - dps_val: all
-            icon: "mdi:thermometer"
             value: Both
   - entity: binary_sensor
     category: diagnostic
@@ -114,7 +128,7 @@ secondary_entities:
         optional: true
         type: bitfield
   - entity: number
-    name: High temperature limit
+    name: Maximum temperature
     category: config
     class: temperature
     icon: "mdi:thermometer-chevron-up"
@@ -128,7 +142,7 @@ secondary_entities:
           min: 30
           max: 90
   - entity: number
-    name: Low temperature limit
+    name: Minimum temperature
     category: config
     class: temperature
     icon: "mdi:thermometer-chevron-down"
@@ -142,9 +156,8 @@ secondary_entities:
           min: 5
           max: 20
   - entity: button
-    name: Reset
+    translation_key: factory_reset
     category: config
-    class: restart
     dps:
       - id: 39
         name: button
@@ -194,7 +207,7 @@ secondary_entities:
         type: integer
         name: value
         optional: true
-        unit: C
+        unit: °
         range:
           min: 1
           max: 5