瀏覽代碼

feat(woods_cortina_airconditioner): support AirSwitch and heat models

- additional entities and model dependent mode coverage

From issue #5138

There may also be an issue with the combination of switch and mode, or it
just be some lacking modes that has caused the problem to be misdiagnosed
by over-eager use of AI to solve problems.

Try the simpler fix first, though on the original PR #1029 the author
did mention that it was sensitive to the order the dps appear in the
request, so it may be fragile enough to completely break between
firmware revisions.
Jason Rumney 1 天之前
父節點
當前提交
c66ee79d19
共有 1 個文件被更改,包括 125 次插入15 次删除
  1. 125 15
      custom_components/tuya_local/devices/woods_cortina_airconditioner.yaml

+ 125 - 15
custom_components/tuya_local/devices/woods_cortina_airconditioner.yaml

@@ -1,8 +1,8 @@
 name: Air conditioner
 name: Air conditioner
-products:
-  # - id: UNKNOWN
-  #   manufacturer: Woods
-  #   model: Cortina Silent 12k
+# products:
+#   - id: UNKNOWN
+#     manufacturer: Woods
+#     model: Cortina Silent 12k
 entities:
 entities:
   - entity: climate
   - entity: climate
     dps:
     dps:
@@ -15,28 +15,44 @@ entities:
           - dps_val: true
           - dps_val: true
             constraint: mode
             constraint: mode
             conditions:
             conditions:
-              - value: cool
-                dps_val: "0"
+              - dps_val: "0"
+                value: cool
               - dps_val: "1"
               - dps_val: "1"
+                value: heat
+                available: heat_model
+              - dps_val: "2"
+                value: dry
+              - dps_val: "3"
+                value: fan_only
+              - dps_val: "4"  # This is Woods ECO or AirSwitch mode
                 value: heat_cool
                 value: heat_cool
-                available: airswitch
-              - value: dry
-                dps_val: "2"
-              - value: fan_only
-                dps_val: "3"
-              - value: heat_cool
-                dps_val: "4"  # This is Woods ECO mode
-                available: eco
+              - dps_val: "5"  # This is Woods AirSwitch Auto mode
+                value: auto
+                available: airswitch_model
       - id: 2
       - id: 2
         type: integer
         type: integer
+        optional: true
         name: temperature
         name: temperature
-        unit: C
         range:
         range:
           min: 17
           min: 17
           max: 30
           max: 30
+        mapping:
+          - constraint: temperature_unit
+            conditions:
+              - dps_val: f
+                value_redirect: temp_set_f
+                range:
+                  min: 62
+                  max: 86
       - id: 3
       - id: 3
         type: integer
         type: integer
+        optional: true
         name: current_temperature
         name: current_temperature
+        mapping:
+          - constraint: temperature_unit
+            conditions:
+              - dps_val: f
+                value_redirect: temp_current_f
       - id: 4
       - id: 4
         type: string
         type: string
         name: mode
         name: mode
@@ -51,6 +67,44 @@ entities:
             value: medium
             value: medium
           - dps_val: "high"
           - dps_val: "high"
             value: high
             value: high
+      - id: 19
+        type: string
+        optional: true
+        name: temperature_unit
+        mapping:
+          - dps_val: f
+            value: F
+          - value: C
+      - id: 23
+        type: integer
+        optional: true
+        name: temp_current_f
+      - id: 24
+        type: integer
+        optional: true
+        name: temp_set_f
+        range:
+          min: 62
+          max: 86
+      - id: 103
+        # 0-NPA, 1-NPF, 2-NPB-cool, 3-NPB-heatcool, 4-NPE-cool, 5-NPE-heatcool
+        type: string
+        name: airswitch_model
+        mapping:
+          - dps_val: "2"
+            value: true
+          - dps_val: "3"
+            value: true
+          - value: false
+      - id: 103
+        type: string
+        name: heat_model
+        mapping:
+          - dps_val: "3"
+            value: true
+          - dps_val: "5"
+            value: true
+          - value: false
       - id: 104
       - id: 104
         name: swing_mode
         name: swing_mode
         type: boolean
         type: boolean
@@ -92,3 +146,59 @@ entities:
       - id: 105
       - id: 105
         type: boolean
         type: boolean
         name: switch
         name: switch
+  - entity: lock
+    translation_key: child_lock
+    category: config
+    dps:
+      - id: 14
+        type: boolean
+        optional: true
+        name: lock
+  - entity: select
+    translation_key: temperature_unit
+    category: config
+    dps:
+      - id: 19
+        type: string
+        optional: true
+        name: option
+        mapping:
+          - dps_val: c
+            value: celsius
+          - dps_val: f
+            value: fahrenheit
+  - entity: switch
+    name: Self clean
+    category: config
+    dps:
+      - id: 102
+        type: boolean
+        optional: true
+        name: switch
+        
+  - entity: sensor
+    name: Outdoor temperature
+    class: temperature
+    dps:
+      - id: 106
+        type: integer
+        optional: true
+        name: sensor
+        class: measurement
+        mapping:
+          - constraint: unit
+            conditions:
+              - dps_val: f
+                value_redirect: temp_f
+      - id: 107
+        type: integer
+        optional: true
+        name: temp_f
+      - id: 19
+        type: string
+        optional: true
+        name: unit
+        mapping:
+          - dps_val: f
+            value: F
+          - value: C