Procházet zdrojové kódy

Summary: feat (daizuki_heatpump): modernize and improve compatibility

Pull in some of the changes from starlight_heatpump to make more functions
encoded in dp 123 available.

Use target_range to scale current_temperature into F range so it can be
pulled into the climate entity.

Allow full swing ranges to be controlled from climate entity.

Make some dps optional to match with TCL Airmax.

Make some entities hidden when unavailable. It is clear that there is
a range of air conditioners matching this group of configs from
daizuki, starlight, fujicool, fisher_summer, hellnar which use the
flags 110 to enable/disable features, but we haven't really decoded
them properly yet, so end up duplicating configs for feature
variations. Try to avoid further expansion of configs as much as
possible by detecting what we can (humidity reading 0 when not
available, other things null)

PR #4051
Jason Rumney před 2 měsíci
rodič
revize
428ca736ef

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -1144,3 +1144,4 @@ Further device support has been made with the assistance of users. Please consid
 - [aniemoeller](https://github.com/aniemoeller) for assisting with support for Jafanda JF260S air purifier.
 - [aniemoeller](https://github.com/aniemoeller) for assisting with support for Jafanda JF260S air purifier.
 - [jlopez77](https://github.com/jlopez77) for contributing support for Haier Airmart air conditioner.
 - [jlopez77](https://github.com/jlopez77) for contributing support for Haier Airmart air conditioner.
 - [MarcoKaldenbach](https://github.com/MarcoKaldenbach) for contributing support for Zedar K1200 cat litter box.
 - [MarcoKaldenbach](https://github.com/MarcoKaldenbach) for contributing support for Zedar K1200 cat litter box.
+- [jaredhobbs](https://github.com/jaredhobbs) for contributing support for TCL AirMax that was merged with Daizuki heatpump.

+ 120 - 11
custom_components/tuya_local/devices/daizuki_heatpump.yaml

@@ -1,4 +1,9 @@
 name: Heat pump
 name: Heat pump
+products:
+  - id: hw50w7qvxluhslkk
+    manufacturer: TCL
+    model: AirMax
+    model_id: AWTLSE18-C2
 entities:
 entities:
   - entity: climate
   - entity: climate
     translation_only_key: aircon_extra
     translation_only_key: aircon_extra
@@ -12,26 +17,37 @@ entities:
           - dps_val: true
           - dps_val: true
             constraint: mode
             constraint: mode
             conditions:
             conditions:
+              - dps_val: auto
+                value: heat_cool
               - dps_val: cold
               - dps_val: cold
                 value: cool
                 value: cool
               - dps_val: hot
               - dps_val: hot
                 value: heat
                 value: heat
-              - dps_val: wet
-                value: dry
               - dps_val: wind
               - dps_val: wind
                 value: fan_only
                 value: fan_only
-              - dps_val: auto
-                value: heat_cool
+              - dps_val: wet
+                value: dry
       - id: 2
       - id: 2
         type: integer
         type: integer
         name: temperature
         name: temperature
+        unit: F
         range:
         range:
           min: 610
           min: 610
           max: 880
           max: 880
         mapping:
         mapping:
           - scale: 10
           - scale: 10
             step: 10
             step: 10
-        unit: F
+      - id: 3
+        type: integer
+        name: current_temperature
+        precision: 0
+        range:
+          min: -20
+          max: 100
+        mapping:
+          - target_range:
+              min: -4
+              max: 212
       - id: 4
       - id: 4
         type: string
         type: string
         name: mode
         name: mode
@@ -56,6 +72,12 @@ entities:
             value: high
             value: high
           - dps_val: strong
           - dps_val: strong
             value: strong
             value: strong
+      - id: 18
+        type: integer
+        name: current_humidity
+        mapping:
+          - dps_val: 0
+            value: null
       - id: 105
       - id: 105
         type: string
         type: string
         name: sleep_mode
         name: sleep_mode
@@ -69,9 +91,11 @@ entities:
           - dps_val: "0"
           - dps_val: "0"
             value: "off"
             value: "off"
           - dps_val: "1"
           - dps_val: "1"
-            value: "on"
-          - value: "on"
-            hidden: true
+            value: Full
+          - dps_val: "2"
+            value: Upper
+          - dps_val: "3"
+            value: Lower
       - id: 114
       - id: 114
         type: string
         type: string
         name: swing_horizontal_mode
         name: swing_horizontal_mode
@@ -79,14 +103,20 @@ entities:
           - dps_val: "0"
           - dps_val: "0"
             value: "off"
             value: "off"
           - dps_val: "1"
           - dps_val: "1"
-            value: "on"
-          - value: "on"
-            hidden: true
+            value: Full
+          - dps_val: "2"
+            value: Left
+          - dps_val: "3"
+            value: Center
+          - dps_val: "4"
+            value: Right
       - id: 119
       - id: 119
         type: string
         type: string
+        optional: true
         name: electricity_management
         name: electricity_management
       - id: 120
       - id: 120
         type: string
         type: string
+        optional: true
         name: gen_mode
         name: gen_mode
       - id: 123
       - id: 123
         type: hex
         type: hex
@@ -97,24 +127,30 @@ entities:
         optional: true
         optional: true
       - id: 128
       - id: 128
         type: string
         type: string
+        optional: true
         name: model_code
         name: model_code
       - id: 129
       - id: 129
         type: string
         type: string
+        optional: true
         name: energy
         name: energy
       - id: 130
       - id: 130
         type: integer
         type: integer
+        optional: true
         name: eco_temp
         name: eco_temp
       - id: 132
       - id: 132
         type: boolean
         type: boolean
         name: hot_cool
         name: hot_cool
       - id: 133
       - id: 133
         type: string
         type: string
+        optional: true
         name: swing_action
         name: swing_action
       - id: 134
       - id: 134
         type: json
         type: json
+        optional: true
         name: statistics
         name: statistics
   - entity: sensor
   - entity: sensor
     class: temperature
     class: temperature
+    deprecated: climate.current_temperature  # 2025-12-03
     dps:
     dps:
       - id: 3
       - id: 3
         name: sensor
         name: sensor
@@ -124,6 +160,7 @@ entities:
   - entity: sensor
   - entity: sensor
     class: humidity
     class: humidity
     category: diagnostic
     category: diagnostic
+    deprecated: climate.current_humidity  # 2025-12-03
     dps:
     dps:
       - id: 18
       - id: 18
         type: integer
         type: integer
@@ -132,6 +169,7 @@ entities:
         class: measurement
         class: measurement
   - entity: select
   - entity: select
     name: Vertical swing
     name: Vertical swing
+    deprecated: climate.swing_mode  # 2025-12-03
     category: config
     category: config
     icon: "mdi:arrow-up-down-bold"
     icon: "mdi:arrow-up-down-bold"
     dps:
     dps:
@@ -170,6 +208,7 @@ entities:
             value: Bottom
             value: Bottom
   - entity: select
   - entity: select
     name: Horizontal swing
     name: Horizontal swing
+    deprecated: climate.swing_horizontal_mode  # 2025-12-03
     category: config
     category: config
     icon: "mdi:arrow-left-right-bold"
     icon: "mdi:arrow-left-right-bold"
     dps:
     dps:
@@ -208,6 +247,23 @@ entities:
             value: Slight Right
             value: Slight Right
           - dps_val: "5"
           - dps_val: "5"
             value: Rightmost
             value: Rightmost
+  - entity: select
+    name: Sleep mode
+    category: config
+    icon: "mdi:weather-night"
+    dps:
+      - id: 105
+        type: string
+        name: option
+        mapping:
+          - dps_val: "off"
+            value: "Off"
+          - dps_val: "normal"
+            value: Standard
+          - dps_val: "old"
+            value: "Elderly"
+          - dps_val: "child"
+            value: "Child"
   - entity: light
   - entity: light
     translation_key: display
     translation_key: display
     category: config
     category: config
@@ -224,6 +280,50 @@ entities:
         type: hex
         type: hex
         name: switch
         name: switch
         mask: "0010"
         mask: "0010"
+  - entity: switch
+    name: Soft wind
+    category: config
+    icon: "mdi:weather-windy"
+    dps:
+      - id: 123
+        type: hex
+        name: switch
+        mask: "8000"
+  - entity: switch
+    name: Anti-mildew
+    category: config
+    icon: "mdi:water-off-outline"
+    dps:
+      - id: 123
+        type: hex
+        name: switch
+        mask: "0100"
+  - entity: switch
+    name: Health
+    category: config
+    icon: "mdi:heart-outline"
+    dps:
+      - id: 123
+        type: hex
+        name: switch
+        mask: "0020"
+  - entity: switch
+    translation_key: anti_frost
+    category: config
+    dps:
+      - id: 123
+        type: hex
+        name: switch
+        mask: "1000"
+  - entity: switch
+    name: Eco mode
+    category: config
+    icon: "mdi:leaf"
+    dps:
+      - id: 123
+        type: hex
+        name: switch
+        mask: "0001"
   - entity: binary_sensor
   - entity: binary_sensor
     class: problem
     class: problem
     category: diagnostic
     category: diagnostic
@@ -241,6 +341,7 @@ entities:
   - entity: sensor
   - entity: sensor
     class: pm25
     class: pm25
     category: diagnostic
     category: diagnostic
+    hidden: unavailable
     dps:
     dps:
       - id: 101
       - id: 101
         type: integer
         type: integer
@@ -248,6 +349,14 @@ entities:
         unit: ugm3
         unit: ugm3
         optional: true
         optional: true
         class: measurement
         class: measurement
+      - id: 101
+        type: integer
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
   - entity: binary_sensor
   - entity: binary_sensor
     name: Filter
     name: Filter
     class: problem
     class: problem