Просмотр исходного кода

add other entities incl. fan and swing modes

Kamil Wojtczyk 5 месяцев назад
Родитель
Сommit
09d3903bfa
1 измененных файлов с 168 добавлено и 2 удалено
  1. 168 2
      custom_components/tuya_local/devices/kaisai_proheat_airconditioner.yaml

+ 168 - 2
custom_components/tuya_local/devices/kaisai_proheat_airconditioner.yaml

@@ -36,7 +36,7 @@ entities:
       - id: 2
         name: temperature
         type: integer
-        unit: C"
+        unit: C
         range:
           min: 1600
           max: 3100
@@ -47,6 +47,172 @@ entities:
       - id: 3
         name: current_temperature
         type: integer
-        unit: "°C"
+        unit: C
+        readonly: true
         mapping:
           - scale: 100
+
+      - id: 5
+        name: fan_mode
+        type: string
+        mapping:
+          # When auto_fan (DP 7) is true, show as auto regardless of manual speed setting
+          - constraint: auto_fan
+            conditions:
+              - dps_val: true
+                value: "auto"
+          # When auto_fan is false, use manual speed settings
+          - dps_val: "1"
+            constraint: auto_fan
+            conditions:
+              - dps_val: false
+                value: "quiet"
+          - dps_val: "2"
+            constraint: auto_fan
+            conditions:
+              - dps_val: false
+                value: "low"
+          - dps_val: "3"
+            constraint: auto_fan
+            conditions:
+              - dps_val: false
+                value: "medium_low"
+          - dps_val: "4"
+            constraint: auto_fan
+            conditions:
+              - dps_val: false
+                value: "medium"
+          - dps_val: "5"
+            constraint: auto_fan
+            conditions:
+              - dps_val: false
+                value: "medium_high"
+          - dps_val: "6"
+            constraint: auto_fan
+            conditions:
+              - dps_val: false
+                value: "high"
+          - dps_val: "7"
+            constraint: auto_fan
+            conditions:
+              - dps_val: false
+                value: "turbo"
+
+      - id: 7
+        name: auto_fan
+        type: boolean
+        hidden: true
+
+      - id: 31
+        name: swing_mode
+        type: string
+        mapping:
+          - dps_val: "0"
+            value: "off"
+          - dps_val: "1"
+            value: "vertical"
+          - dps_val: "2"
+            value: "up"
+          - dps_val: "3"
+            value: "down"
+          - dps_val: "9"
+            value: "up_fixed"
+          - dps_val: "10"
+            value: "up_offset_fixed"
+          - dps_val: "11"
+            value: "middle_fixed"
+          - dps_val: "12"
+            value: "down_offset_fixed"
+          - dps_val: "13"
+            value: "down_fixed"
+
+      - id: 34
+        name: swing_horizontal_mode
+        type: string
+        mapping:
+          - dps_val: "0"
+            value: "off"
+          - dps_val: "1"
+            value: "horizontal"
+          - dps_val: "2"
+            value: "left"
+          - dps_val: "3"
+            value: "center"
+          - dps_val: "4"
+            value: "right"
+          - dps_val: "9"
+            value: "left_fixed"
+          - dps_val: "10"
+            value: "left_offset_fixed"
+          - dps_val: "11"
+            value: "center_fixed"
+          - dps_val: "12"
+            value: "right_offset_fixed"
+          - dps_val: "13"
+            value: "right_fixed"
+
+      - id: 8
+        name: preset_mode
+        type: boolean
+        mapping:
+          - dps_val: false
+            value: "none"
+          - dps_val: true
+            value: "eco"
+
+  - entity: sensor
+    name: "Outdoor Temperature"
+    class: temperature
+    dps:
+      - id: 116
+        name: sensor
+        type: integer
+        unit: C
+        readonly: true
+        optional: true
+        mapping:
+          - scale: 100
+
+  - entity: sensor
+    name: "Electricity Usage"
+    class: energy
+    dps:
+      - id: 127
+        name: sensor
+        type: integer
+        unit: kWh
+        class: total_increasing
+        readonly: true
+        optional: true
+        mapping:
+          - scale: 100
+
+  - entity: sensor
+    name: "External Fan Speed"
+    dps:
+      - id: 117
+        name: sensor
+        type: integer
+        unit: rpm
+        readonly: true
+        optional: true
+
+  - entity: sensor
+    name: "Compressor Frequency"
+    dps:
+      - id: 119
+        name: sensor
+        type: integer
+        unit: Hz
+        readonly: true
+        optional: true
+
+  - entity: binary_sensor
+    name: "Filter Block Status"
+    class: problem
+    dps:
+      - id: 110
+        name: sensor
+        type: boolean
+        readonly: true
+        optional: true