Explorar el Código

feat(thermoval_aquati_waterheater): support new firmware version

Product id is unchanged, but dps mapping is quite different.

- dp: 2, which mapped simply to the water heater operation mode before
  now indicates either instant or scheduled heating. Power levels are
  on new dp 101 which map roughly to the eco, electric, performance
  mapping of the original.
- dp 16 carries a schedule (timer) which is presumably new to go with
  the scheduled heating mode.

Due to the identical product id, I tried to handle both variants in the
same config, even though it is a little more complex than I would like.

Issue #5355
Jason Rumney hace 1 semana
padre
commit
308d56072a

+ 90 - 0
custom_components/tuya_local/devices/thermoval_aquati_waterheater.yaml

@@ -19,14 +19,42 @@ entities:
             conditions:
               - dps_val: Manual
                 value: electric
+                available: orig_firmware
               - dps_val: Eco
                 value: eco
+                available: orig_firmware
               - dps_val: Turbo
                 value: performance
+                available: orig_firmware
+              - dps_val: [jiheat, yuyue]
+                value_redirect: power_level
+                available: new_firmware
       - id: 2
         type: string
         name: work_mode
         hidden: true
+      - id: 2
+        type: string
+        name: orig_firmware
+        hidden: true
+        mapping:
+          - dps_val: Manual
+            value: true
+          - dps_val: Eco
+            value: true
+          - dps_val: Turbo
+            value: true
+          - value: false
+      - id: 2
+        type: string
+        name: new_firmware
+        hidden: true
+        mapping:
+          - dps_val: jiheat
+            value: true
+          - dps_val: yuyue
+            value: true
+          - value: false
       - id: 9
         type: integer
         name: temperature
@@ -39,6 +67,26 @@ entities:
       - id: 10
         type: integer
         name: current_temperature
+      - id: 101
+        type: string
+        optional: true
+        name: power_level
+        mapping:
+          - dps_val: "700W_800W"
+            constraint: operation_mode
+            conditions:
+              - dps_val: true
+                value: eco
+          - dps_val: "1200W_1300W"
+            constraint: operation_mode
+            conditions:
+              - dps_val: true
+                value: electric
+          - dps_val: "2000W"
+            constraint: operation_mode
+            conditions:
+              - dps_val: true
+                value: performance
   - entity: binary_sensor
     class: problem
     category: diagnostic
@@ -68,3 +116,45 @@ entities:
             value: heating
           - dps_val: Warm
             value: keeping_warm
+          - dps_val: standby
+            value: idle
+          - dps_val: heating
+            value: heating
+          - dps_val: warm
+            value: keeping_warm
+          - dps_val: yuyue
+            value: scheduled
+          - dps_val: fangdong
+            value: anti_freeze
+  - entity: switch
+    name: Schedule
+    category: config
+    hidden: unavailable
+    dps:
+      - id: 2
+        type: string
+        name: switch
+        mapping:
+          - dps_val: jiheat
+            value: false
+          - dps_val: yuyue
+            value: true
+          - value: null
+      - id: 2
+        type: string
+        name: available
+        mapping:
+          - dps_val: jiheat
+            value: true
+          - dps_val: yuyue
+            value: true
+          - value: false
+  - entity: text
+    translation_key: schedule
+    category: config
+    hidden: true
+    dps:
+      - id: 16
+        type: base64
+        optional: true
+        name: value