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

fix (breville_airrounderplus_heater): split fan and heat

Due to the complex interaction of dps 1, 4, and 5, it is difficult to
combine all the features into a climate entity. When fan is active,
dp 4 goes to heat_low, and when heat is active, dp 5 goes to SleepWind,
but setting those dps to those values does not automatically start
the other mode.

Another approach that reduces the complexity is to only support heat
mode in the climate entity, and use a separate fan entity for the fan modes

With this configuration, turning the climate on will enable the heating mode
and automatically show the fan as off. Turning on the fan will enable fan
mode and automatically show the climate entity as off. Turning either off
will turn off the switch for the whole device.

Due to the limitation of having to ensure a valid mode is set when turning
on, the middle setting will be automatically activated

Another behaviour which may be surprising (but also useful once it is
understood) is that the climate toggle action will toggle the switch
without changing dp 4 or 5, which should turn the device on with the
last settings. This means that the fan might be turned on instead of
the climate entity by the climate toggle action.

Issue #3582
Jason Rumney 4 месяцев назад
Родитель
Сommit
43f478793e

+ 47 - 40
custom_components/tuya_local/devices/breville_airrounderplus_heater.yaml

@@ -16,10 +16,10 @@ entities:
           - dps_val: true
             value: heat
             hidden: true
-            constraint: heat_mode
+            constraint: fan_mode
             conditions:
               - dps_val: heat_low
-                value: fan_only
+                value: "off"
               - dps_val: heat_high
                 value: heat
       - id: 2
@@ -33,51 +33,18 @@ entities:
         type: integer
         name: current_temperature
       - id: 4
-        type: string
-        name: heat_mode
-        hidden: true
-      - id: 5
         type: string
         name: fan_mode
         mapping:
-          - dps_val: SleepWind
-            constraint: heat_mode
-            conditions:
-              - dps_val: heat_mid
-                value: low
-                available: in_heat_mode
-              - dps_val: heat_high
-                value: medium
-                available: in_heat_mode
-              - dps_val: heat_0
-                value: high
-                available: in_heat_mode
-              - dps_val: heat_low
-                value: "off"
-                hidden: true
-          - dps_val: NatureWind_Low
+          - dps_val: heat_mid
             value: low
-            available: in_fan_mode
-          - dps_val: NatureWind_High
+          - dps_val: heat_high
             value: medium
-            available: in_fan_mode
-          - dps_val: CoolWind_0
+          - dps_val: heat_0
             value: high
-            available: in_fan_mode
-      - id: 5
-        type: string
-        name: in_fan_mode
-        mapping:
-          - dps_val: SleepWind
-            value: false
-          - value: true
-      - id: 4
-        type: string
-        name: in_heat_mode
-        mapping:
           - dps_val: heat_low
-            value: false
-          - value: true
+            value: "off"
+            hidden: true
       - id: 101
         type: string
         name: swing_mode
@@ -90,6 +57,46 @@ entities:
             value: "120°"
           - dps_val: "180"
             value: "360°"
+  - entity: fan
+    dps:
+      - id: 1
+        type: boolean
+        name: switch
+        mapping:
+          - dps_val: false
+            value: false
+          - dps_val: true
+            value: true
+            hidden: true
+            constraint: speed
+            conditions:
+              - dps_val: SleepWInd
+                value: false
+                hidden: true
+              - dps_val: NatureWind_High
+                value: true
+      - id: 5
+        type: string
+        name: speed
+        mapping:
+          - dps_val: SleepWind
+            value: 0
+            hidden: true
+          - dps_val: NatureWind_Low
+            value: 33
+          - dps_val: NatureWind_High
+            value: 66
+          - dps_val: CoolWind_0
+            value: 100
+      - id: 101
+        type: string
+        name: oscillate
+        mapping:
+          - dps_val: "off"
+            value: false
+          - dps_val: "180"
+            value: true
+          - value: true
   - entity: lock
     translation_key: child_lock
     category: config