Sfoglia il codice sorgente

Tweaks to Wilfa Haze config.

These changes were made after reading the manual to understand the device functionality.

- Move intensity to a fan entity so it can be set easily.
- rename light_sleep to light_display to take advantage of existing translation
- rename switch_heater to switch_air_clean to take advantage of existing translation
- include the temperature unit as an attribute on current temperature so it can be used to specify the actual unit being used.
Jason Rumney 3 anni fa
parent
commit
009638f3d7

+ 42 - 41
custom_components/tuya_local/devices/wilfa_haze_hu400bc_humidifier.yaml

@@ -19,20 +19,11 @@ primary_entity:
       range:
         min: 30
         max: 90
-    - id: 23
-      type: string
-      name: intensity
       mapping:
-        - dps_val: ONE
-          value: level_0
-        - dps_val: TWO
-          value: level_1
-        - dps_val: THREE
-          value: level_2
-        - dps_val: FOUR
-          value: level_3
-        - dps_val: FIVE
-          value: level_4
+        - constraint: mode
+          conditions:
+            - dps_val: AUTO
+              invalid: true
     - id: 24
       type: string
       name: mode
@@ -41,7 +32,32 @@ primary_entity:
           value: auto
         - dps_val: MANUAL
           value: humidity
+    - id: 20
+      type: integer
+      name: unknown_20
+    - id: 22
+      type: integer
+      name: unknown_22
 secondary_entities:
+  - entity: fan
+    dps:
+      - id: 1
+        name: switch
+        type: boolean
+      - id: 23
+        type: string
+        name: speed
+        mapping:
+          - dps_val: ONE
+            value: 20
+          - dps_val: TWO
+            value: 40
+          - dps_val: THREE
+            value: 60
+          - dps_val: FOUR
+            value: 80
+          - dps_val: FIVE
+            value: 100
   - entity: light
     name: Mood
     category: config
@@ -74,7 +90,14 @@ secondary_entities:
         name: sensor
         type: integer 
         class: measurement
-        unit: "°C/°F"
+      - id: 18
+        name: unit
+        type: string
+        mapping:
+          - dps_val: c
+            value: C
+          - dps_val: f
+            value: F
   - entity: sensor
     name: Current Humidity
     class: humidity
@@ -85,7 +108,7 @@ secondary_entities:
         class: measurement
         unit: "%"
   - entity: light
-    name: Sleep
+    name: Display
     category: config
     dps:
       - id: 16
@@ -93,8 +116,10 @@ secondary_entities:
         name: switch
         mapping:
             - dps_val: true
+              value: false
               icon: "mdi:led-off"
             - dps_val: false
+              value: true
               icon: "mdi:led-on"
   - entity: select
     category: config
@@ -144,34 +169,10 @@ secondary_entities:
             value: "11 hours"
           - dps_val: "12"
             value: "12 hours"
-  - entity: binary_sensor
-    name: Diag20
-    class: problem
-    category: diagnostic
-    dps:
-      - id: 20
-        name: sensor
-        type: bitfield
-        mapping:
-          - dps_val: 0
-            value: false
-          - value: true
-  - entity: binary_sensor
-    name: Diag22
-    class: problem
-    category: diagnostic
-    dps:
-      - id: 22
-        name: sensor
-        type: bitfield
-        mapping:
-          - dps_val: 0
-            value: false
-          - value: true
   - entity: switch
-    name: Heater
+    name: Air Clean
     category: config
-    icon: "mdi:fire"
+    icon: "mdi:air-purifier"
     dps:
       - id: 26
         name: switch

+ 2 - 0
custom_components/tuya_local/translations/en.json

@@ -68,6 +68,7 @@
                     "light_display": "Include display as a light entity",
                     "light_flame": "Include flame as a light entity",
 		    "light_led": "Include LED as a light entity",
+		    "light_mood": "Include mood light as a light entity",
 		    "light_night_light": "Include night light as a light entity",
                     "light_uv_sterilization": "Include UV sterilization as a light entity",
                     "lock_child_lock": "Include child lock as a lock entity",
@@ -250,6 +251,7 @@
                     "light_display": "Include display as a light entity",
                     "light_flame": "Include flame as a light entity",
 		    "light_led": "Include LED as a light entity",
+		    "light_mood": "Include mood light as a light entity",
 		    "light_night_light": "Include night light as a light entity",
                     "light_uv_sterilization": "Include UV sterilization as a light entity",
                     "lock_child_lock": "Include child lock as a lock entity",