浏览代码

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 1 周之前
父节点
当前提交
308d56072a
共有 1 个文件被更改,包括 90 次插入0 次删除
  1. 90 0
      custom_components/tuya_local/devices/thermoval_aquati_waterheater.yaml

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

@@ -19,14 +19,42 @@ entities:
             conditions:
             conditions:
               - dps_val: Manual
               - dps_val: Manual
                 value: electric
                 value: electric
+                available: orig_firmware
               - dps_val: Eco
               - dps_val: Eco
                 value: eco
                 value: eco
+                available: orig_firmware
               - dps_val: Turbo
               - dps_val: Turbo
                 value: performance
                 value: performance
+                available: orig_firmware
+              - dps_val: [jiheat, yuyue]
+                value_redirect: power_level
+                available: new_firmware
       - id: 2
       - id: 2
         type: string
         type: string
         name: work_mode
         name: work_mode
         hidden: true
         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
       - id: 9
         type: integer
         type: integer
         name: temperature
         name: temperature
@@ -39,6 +67,26 @@ entities:
       - id: 10
       - id: 10
         type: integer
         type: integer
         name: current_temperature
         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
   - entity: binary_sensor
     class: problem
     class: problem
     category: diagnostic
     category: diagnostic
@@ -68,3 +116,45 @@ entities:
             value: heating
             value: heating
           - dps_val: Warm
           - dps_val: Warm
             value: keeping_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