Kaynağa Gözat

Poolex Q-7: deprecate water_heater, replace with climate

The original request #777 only mentioned heating ability, and dp 4 was not
listed in the iot.tuya.com info, though the log value ECO_Heat fits with
the presets listed in PR #966 for an otherwise compatible Poolsana model.

Move to a climate entity so both heating and cooling can be controlled,
fill in the presets accoring to our standard pool heatpump presets, and
reduce the temperature range to the Poolsana range that is more reasonable
for pool heatpumps (the 5-80 range seems more suited to hot water systems)
Jason Rumney 2 yıl önce
ebeveyn
işleme
c30710682d

+ 111 - 12
custom_components/tuya_local/devices/poolex_q7_heatpump.yaml

@@ -1,31 +1,47 @@
-name: Poolex Q-7 pool heatpump
+name: Pool heatpump
 products:
 products:
   - id: qhrpnqjhakrn3jvv
   - id: qhrpnqjhakrn3jvv
+    name: Poolex Qline Q-7
+    # unknown id: Poolsana InverPower
 primary_entity:
 primary_entity:
-  entity: water_heater
+  entity: climate
   icon: "mdi:pool-thermometer"
   icon: "mdi:pool-thermometer"
+  translation_key: pool_heatpump
   dps:
   dps:
     - id: 1
     - id: 1
       type: boolean
       type: boolean
-      name: operation_mode
+      name: hvac_mode
       mapping:
       mapping:
         - dps_val: false
         - dps_val: false
-          value: off
+          value: "off"
         - dps_val: true
         - dps_val: true
-          value: heatpump
+          constraint: preset_mode
+          conditions:
+            - dps_val: Boost_Heat 
+              value: heat
+            - dps_val: Silent_Heat
+              value: heat
+            - dps_val: ECO_Heat
+              value: heat
+            - dps_val: Boost_Cool
+              value: cool
+            - dps_val: Silent_Cool
+              value: cool
+            - dps_val: ECO_Cool
+              value: cool
     - id: 2
     - id: 2
       type: integer
       type: integer
       name: temperature
       name: temperature
       range:
       range:
-        min: 5
-        max: 80
+        min: 20
+        max: 40
       mapping:
       mapping:
         - constraint: temperature_unit
         - constraint: temperature_unit
           conditions:
           conditions:
             - dps_val: f
             - dps_val: f
               range:
               range:
-                min: 41
-                max: 176
+                min: 68
+                max: 104
               value_redirect: temp_set_f
               value_redirect: temp_set_f
     - id: 3
     - id: 3
       type: integer
       type: integer
@@ -35,6 +51,20 @@ primary_entity:
           conditions:
           conditions:
             - dps_val: f
             - dps_val: f
               value_redirect: temp_current_f
               value_redirect: temp_current_f
+    - id: 11
+      type: string
+      name: hvac_action
+      mapping:
+        - dps_val: heating
+          value: heating
+        - dps_val: cooling
+          value: cooling
+        - constraint: hvac_mode
+          conditions:
+            - dps_val: false
+              value: "off"
+            - dps_val: true
+              value: idle
     - id: 13
     - id: 13
       type: string
       type: string
       name: temperature_unit
       name: temperature_unit
@@ -47,8 +77,8 @@ primary_entity:
       type: integer
       type: integer
       name: temp_set_f
       name: temp_set_f
       range:
       range:
-        min: 41
-        max: 176
+        min: 68
+        max: 104
       hidden: true
       hidden: true
       optional: true
       optional: true
     - id: 15
     - id: 15
@@ -58,11 +88,80 @@ primary_entity:
       optional: true
       optional: true
     - id: 4
     - id: 4
       type: string
       type: string
-      name: unknown_4
+      name: preset_mode
+      mapping:
+        - dps_val: Boost_Heat
+          value: quick_heat
+        - dps_val: Silent_Heat
+          value: quiet_heat
+        - dps_val: ECO_Heat
+          value: smart_heat
+        - dps_val: ECO_Cool
+          value: smart_cool
+        - dps_val: Silent_Cool
+          value: quiet_cool
+        - dps_val: Boost_Cool
+          value: quick_cool
     - id: 21
     - id: 21
       type: integer
       type: integer
       name: unknown_21
       name: unknown_21
 secondary_entities:
 secondary_entities:
+  - entity: water_heater
+    icon: "mdi:pool-thermometer"
+    deprecated: climate
+    category: config
+    dps:
+      - id: 1
+        type: boolean
+        name: operation_mode
+        mapping:
+          - dps_val: false
+            value: "off"
+          - dps_val: true
+            value: heatpump
+      - id: 2
+        type: integer
+        name: temperature
+        range:
+          min: 5
+          max: 80
+        mapping:
+          - constraint: temperature_unit
+            conditions:
+              - dps_val: f
+                range:
+                  min: 41
+                  max: 176
+                value_redirect: temp_set_f
+      - id: 3
+        type: integer
+        name: current_temperature
+        mapping:
+          - constraint: temperature_unit
+            conditions:
+              - dps_val: f
+                value_redirect: temp_current_f
+      - id: 13
+        type: string
+        name: temperature_unit
+        mapping:
+          - dps_val: c
+            value: C
+          - dps_val: f
+            value: F
+      - id: 14
+        type: integer
+        name: temp_set_f
+        range:
+          min: 41
+          max: 176
+        hidden: true
+        optional: true
+      - id: 15
+        type: integer
+        name: temp_current_f
+        hidden: true
+        optional: true
   - entity: select
   - entity: select
     name: Temperature unit
     name: Temperature unit
     icon: "mdi:temperature-celsius"
     icon: "mdi:temperature-celsius"