Răsfoiți Sursa

fix(hy_combo_heatpump): improve detection

Based on user experience, many of the dps can be missing in the
initial data returned by the device. Mark these as optional, and
handle the case of them missing (some like "mode" are quite fundamental
to the device working correctly, so hopefully this is only a transient
problem and their real values are returned soon after starting.

Also added product id that was previously missing.

Issue #2510
Jason Rumney 5 luni în urmă
părinte
comite
985be85c64
1 a modificat fișierele cu 49 adăugiri și 3 ștergeri
  1. 49 3
      custom_components/tuya_local/devices/hy_combo_heatpump.yaml

+ 49 - 3
custom_components/tuya_local/devices/hy_combo_heatpump.yaml

@@ -1,7 +1,7 @@
 name: Multifunction heat pump
 name: Multifunction heat pump
-# products:
-#   - id: UNKNOWN
-#     model: HY V1.2
+products:
+  - id: 60todr4yfe2mrcib
+    model: HY V1.2
 entities:
 entities:
   - entity: climate
   - entity: climate
     dps:
     dps:
@@ -30,21 +30,29 @@ entities:
               - dps_val: Hot_Cooling
               - dps_val: Hot_Cooling
                 value: cool
                 value: cool
                 available: water_on
                 available: water_on
+              - dps_val: null
+                value: "off"
+                hidden: true
       - id: 2
       - id: 2
         type: string
         type: string
+        optional: true
         name: mode
         name: mode
       - id: 2
       - id: 2
         type: string
         type: string
         name: water_on
         name: water_on
+        optional: true
         hidden: true
         hidden: true
         mapping:
         mapping:
           - dps_val: Cooling
           - dps_val: Cooling
             value: false
             value: false
           - dps_val: Heating
           - dps_val: Heating
             value: false
             value: false
+          - dps_val: null
+            value: false
           - value: true
           - value: true
       - id: 2
       - id: 2
         type: string
         type: string
+        optional: true
         name: water_off
         name: water_off
         hidden: true
         hidden: true
         mapping:
         mapping:
@@ -52,6 +60,8 @@ entities:
             value: true
             value: true
           - dps_val: Heating
           - dps_val: Heating
             value: true
             value: true
+          - dps_val: null
+            value: true
           - value: false
           - value: false
       - id: 21
       - id: 21
         type: integer
         type: integer
@@ -75,6 +85,7 @@ entities:
                   max: 25
                   max: 25
       - id: 118
       - id: 118
         type: integer
         type: integer
+        optional: true
         name: cool_temperature
         name: cool_temperature
         range:
         range:
           min: 7
           min: 7
@@ -92,6 +103,7 @@ entities:
             value: heat_pump
             value: heat_pump
       - id: 119
       - id: 119
         type: integer
         type: integer
+        optional: true
         name: temperature
         name: temperature
         unit: C
         unit: C
         range:
         range:
@@ -108,6 +120,7 @@ entities:
     dps:
     dps:
       - id: 2
       - id: 2
         type: string
         type: string
+        optional: true
         name: option
         name: option
         mapping:
         mapping:
           - dps_val: Hot
           - dps_val: Hot
@@ -127,23 +140,33 @@ entities:
     dps:
     dps:
       - id: 3
       - id: 3
         type: boolean
         type: boolean
+        optional: true
         name: switch
         name: switch
+        mapping:
+          - dps_val: null
+            value: false
+            hidden: true
   - entity: binary_sensor
   - entity: binary_sensor
     class: problem
     class: problem
     category: diagnostic
     category: diagnostic
     dps:
     dps:
       - id: 15
       - id: 15
         type: bitfield
         type: bitfield
+        optional: true
         name: sensor
         name: sensor
         mapping:
         mapping:
           - dps_val: 0
           - dps_val: 0
             value_redirect: fault_2
             value_redirect: fault_2
+          - dps_val: null
+            value_redirect: fault_2
           - value: true
           - value: true
       - id: 15
       - id: 15
         type: bitfield
         type: bitfield
+        optional: true
         name: fault_code
         name: fault_code
       - id: 35
       - id: 35
         type: integer
         type: integer
+        optional: true
         name: fault_7
         name: fault_7
         hidden: true
         hidden: true
         mapping:
         mapping:
@@ -152,61 +175,82 @@ entities:
           - value: true
           - value: true
       - id: 35
       - id: 35
         type: integer
         type: integer
+        optional: true
         name: fault_code_7
         name: fault_code_7
       - id: 109
       - id: 109
         type: bitfield
         type: bitfield
+        optional: true
         name: fault_2
         name: fault_2
         hidden: true
         hidden: true
         mapping:
         mapping:
           - dps_val: 0
           - dps_val: 0
             value_redirect: fault_3
             value_redirect: fault_3
+          - dps_val: null
+            value_redirect: fault_3
           - value: true
           - value: true
       - id: 109
       - id: 109
         type: bitfield
         type: bitfield
+        optional: true
         name: fault_code_2
         name: fault_code_2
       - id: 120
       - id: 120
         type: bitfield
         type: bitfield
+        optional: true
         name: fault_3
         name: fault_3
         hidden: true
         hidden: true
         mapping:
         mapping:
           - dps_val: 0
           - dps_val: 0
             value_redirect: fault_4
             value_redirect: fault_4
+          - dps_val: null
+            value_redirect: fault_4
           - value: true
           - value: true
       - id: 120
       - id: 120
         type: bitfield
         type: bitfield
+        optional: true
         name: fault_code_3
         name: fault_code_3
       - id: 121
       - id: 121
         type: bitfield
         type: bitfield
+        optional: true
         name: fault_4
         name: fault_4
         hidden: true
         hidden: true
         mapping:
         mapping:
           - dps_val: 0
           - dps_val: 0
             value_redirect: fault_5
             value_redirect: fault_5
+          - dps_val: null
+            value_redirect: fault_5
           - value: true
           - value: true
       - id: 121
       - id: 121
         type: bitfield
         type: bitfield
+        optional: true
         name: fault_code_4
         name: fault_code_4
       - id: 122
       - id: 122
         type: bitfield
         type: bitfield
+        optional: true
         name: fault_5
         name: fault_5
         hidden: true
         hidden: true
         mapping:
         mapping:
           - dps_val: 0
           - dps_val: 0
             value_redirect: fault_6
             value_redirect: fault_6
+          - dps_val: null
+            value_redirect: fault_6
           - value: true
           - value: true
       - id: 122
       - id: 122
         type: bitfield
         type: bitfield
+        optional: true
         name: fault_code_5
         name: fault_code_5
       - id: 123
       - id: 123
         type: bitfield
         type: bitfield
+        optional: true
         name: fault_6
         name: fault_6
         hidden: true
         hidden: true
         mapping:
         mapping:
           - dps_val: 0
           - dps_val: 0
             value_redirect: fault_7
             value_redirect: fault_7
+          - dps_val: null
+            value_redirect: fault_7
           - value: true
           - value: true
       - id: 123
       - id: 123
         type: bitfield
         type: bitfield
+        optional: true
         name: fault_code_6
         name: fault_code_6
   - entity: number
   - entity: number
     name: Night start
     name: Night start
@@ -215,6 +259,7 @@ entities:
     dps:
     dps:
       - id: 4
       - id: 4
         type: integer
         type: integer
+        optional: true
         name: value
         name: value
         unit: h
         unit: h
         range:
         range:
@@ -227,6 +272,7 @@ entities:
     dps:
     dps:
       - id: 10
       - id: 10
         type: integer
         type: integer
+        optional: true
         name: value
         name: value
         unit: h
         unit: h
         range:
         range: