Browse Source

Add support for Cadence aroma diffuser

Issue #976

YYM aroma nightlight: add quotes around values with colons embedded,
don't map boolean values to themselves.
Jason Rumney 2 years ago
parent
commit
fe3deef7c0

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -336,3 +336,4 @@ Further device support has been made with the assistance of users.  Please consi
 - [nima-002](https://github.com/nima-002) for contributing improvements to Moebot S lawnmowers.
 - [nima-002](https://github.com/nima-002) for contributing improvements to Moebot S lawnmowers.
 - [maxupunk](https://github.com/maxupunk) for assistance with support for Kabum Smart 700 vacuum cleaners.
 - [maxupunk](https://github.com/maxupunk) for assistance with support for Kabum Smart 700 vacuum cleaners.
 - [thugseus](https://github.com/thugseus) for assistance with support for HU06 Bluetooth smart locks.
 - [thugseus](https://github.com/thugseus) for assistance with support for HU06 Bluetooth smart locks.
+- [jaydensmith](https://github.com/jaydensmith) for assistance with support for Cadence aroma diffusers.

+ 1 - 0
DEVICES.md

@@ -204,6 +204,7 @@
 ### Aroma diffusers
 ### Aroma diffusers
 
 
 - Asakuki aroma diffuser with light
 - Asakuki aroma diffuser with light
+- Cadance ultrasonic aroma diffuser with light and music playback
 - Ditua DT-1522-YN aroma diffuser
 - Ditua DT-1522-YN aroma diffuser
 - Etersky aroma diffuser with light
 - Etersky aroma diffuser with light
 - YYM-805SW aroma diffuser with light (also supports GX Aroma diffuser)
 - YYM-805SW aroma diffuser with light (also supports GX Aroma diffuser)

+ 145 - 0
custom_components/tuya_local/devices/cadence_aroma_diffuser.yaml

@@ -0,0 +1,145 @@
+name: Aroma diffuser
+products:
+  - id: 1sim2gu7dd5rh3j3
+    name: Cadence ultrasonic aroma diffuser
+primary_entity:
+  entity: fan
+  translation_key: fan_with_presets
+  dps:
+    - id: 2
+      name: switch
+      type: boolean
+      mapping:
+        - dps_val: true
+          icon: "mdi:scent"
+        - dps_val: false
+          icon: "mdi:scent-off"
+    - id: 103
+      name: preset_mode
+      type: string
+      mapping:
+        - dps_val: continued
+          value: normal
+        - dps_val: indirect
+          value: nature
+secondary_entities:
+  - entity: switch
+    name: Power
+    category: config
+    dps:
+      - id: 1
+        type: boolean
+        name: switch
+  - entity: light
+    dps:
+      - id: 7
+        type: boolean
+        name: switch
+      - id: 8
+        name: brightness
+        type: integer
+        range:
+          min: 10
+          max: 1000
+        mapping:
+          - scale: 3.92
+      # 10: rgbhsv, but not present in log and no color_mode to select it, so probably a doc error
+      - id: 105
+        name: effect
+        type: boolean
+        mapping:
+          - dps_val: false
+            value: Static
+          - dps_val: true
+            value: Rotate
+      - id: 111
+        name: control_data
+        type: string
+        optional: true
+  - entity: select
+    name: Internal music
+    icon: "mdi:music"
+    category: config
+    dps:
+      - id: 101 
+        type: string
+        name: option
+        mapping:
+          - dps_val: "0" 
+            value: Track 1
+          - dps_val: "1"
+            value: Track 2
+          - dps_val: "2"
+            value: Track 3
+          - dps_val: "3"
+            value: Track 4
+          - dps_val: "4"
+            value: Track 5
+          - dps_val: "5"
+            value: Track 6
+  - entity: number
+    name: Volume
+    icon: "mdi:volume-high"
+    dps:
+      - id: 102
+        type: integer
+        name: value
+        unit: "%"
+        range:
+          min: 0
+          max: 30
+        mapping:
+          - scale: 0.3
+  - entity: switch
+    name: Sleep timer
+    icon: "mdi:bed-clock"
+    category: config
+    dps:
+      - id: 104
+        type: boolean
+        name: switch
+  - entity: button
+    name: Previous track
+    icon: "mdi:skip-backward"
+    dps:
+      - id: 106
+        type: boolean
+        name: button
+        optional: true
+  - entity: button
+    name: Next track
+    icon: "mdi:skip-forward"
+    dps:
+      - id: 107
+        type: boolean
+        name: button 
+        optional: true
+  - entity: button
+    name: Play music
+    icon: "mdi:play"
+    dps:
+      - id: 108
+        type: boolean
+        name: button
+        optional: true
+  - entity: number
+    name: Timer
+    category: config
+    icon: "mdi:timer"
+    dps:
+      - id: 109
+        type: integer
+        name: value
+        unit: min
+        range:
+          min: 0
+          max: 1200
+  - entity: button
+    name: Bluetooth pairing
+    category: config
+    icon: "mdi:bluetooth-connect"
+    dps:
+      - id: 110
+        type: boolean
+        name: button
+        optional: true

+ 2 - 4
custom_components/tuya_local/devices/yym_805SW_aroma_nightlight.yaml

@@ -15,11 +15,9 @@ primary_entity:
       type: boolean
       type: boolean
       mapping:
       mapping:
         - dps_val: true
         - dps_val: true
-          icon: mdi:scent
-          value: ON
+          icon: "mdi:scent"
         - dps_val: false
         - dps_val: false
-          icon: mdi:scent-off
-          value: OFF
+          icon: "mdi:scent-off"
     - id: 2
     - id: 2
       name: speed
       name: speed
       type: string
       type: string