Procházet zdrojové kódy

Add support for Bluetooth Solar Garden light

Issue #605
Jason Rumney před 2 roky
rodič
revize
0d9129b99d

+ 1 - 1
ACKNOWLEDGEMENTS.md

@@ -91,7 +91,7 @@ Further device support has been made with the assistance of users.  Please consi
 - [Swiftnesses](https://github.com/Swiftnesses) for assistance with Devola patio heaters and Atomi string lights.
 - [odeBuXTeR](https://github.com/odeBuXTeR) for contributing support for Poolex Q-line pool heatpumps.
 - [peterforeman](https:github.com/peterforeman) for assistance with improving Fairland/Madimack support.
-- [Krispkiwi](https://github.com/Krispkiwi) for assistance with M027 curtain modules and debugging Kogan Kettle.
+- [Krispkiwi](https://github.com/Krispkiwi) for assistance with M027 curtain modules, Smart Ape solar lights and debugging Kogan Kettle.
 - [craibo](https://github.com/craibo) for contributing support for Jiahong ET-72W thermostats.
 - [x-keita](https://github.com/x-keita) for contributing support for Betterlife BL1500 IR heaters and Nexxt smart switches.
 - [Der-Nax](https:github.com/Der-Nax) for assistance with a second variant of energy monitoring smart switch and for contributing support for PY321-TY power clamps, Compteur smart meters and sensors on a Universal Remote Control.

+ 1 - 0
DEVICES.md

@@ -455,6 +455,7 @@ of device.
 - HCT-611 water timer
 - Orion DL021HA lock
 - PT216/PT19DB-2 temperature and humidity sensor
+- Smart Ape solar garden light
 - Generic water timers (confirmed with Johgee and Diivoo branded devices)
 
 ### Devices supported via IR hubs

+ 227 - 0
custom_components/tuya_local/devices/ble_solar_light.yaml

@@ -0,0 +1,227 @@
+name: Solar garden light
+products:
+  - id: bt1raf68
+    name: Smart Ape solar garden light
+primary_entity:
+  entity: light
+  dps:
+    - id: 1
+      name: switch
+      type: boolean
+    - id: 2
+      name: color_mode
+      type: string
+      mapping:
+        - dps_val: white
+          value: color_temp
+        - dps_val: colour
+          value: hs
+        - dps_val: scene
+          value: Scene
+        - dps_val: music
+          value: Music
+    - id: 3
+      name: brightness
+      type: integer
+      range:
+        min: 10
+        max: 1000
+      mapping:
+        - scale: 3.92
+          constraint: standby
+          conditions:
+            - dps_val: true
+              value_redirect: standby_brightness
+    - id: 4
+      name: color_temp
+      type: integer
+      range:
+        min: 0
+        max: 1000
+      mapping:
+        - invert: true
+    - id: 5
+      name: rgbhsv
+      type: hex
+      format:
+        - name: h
+          bytes: 2
+          range:
+            min: 0
+            max: 360
+        - name: s
+          bytes: 2
+          range:
+            min: 0
+            max: 1000
+        - name: v
+          bytes: 2
+          range:
+            min: 0
+            max: 1000
+    - id: 6
+      name: scene_data
+      type: hex
+    - id: 8
+      name: music_data
+      type: hex
+      optional: true
+    - id: 59
+      name: standby_brightness
+      type: integer
+      optional: true
+      range:
+        min: 0
+        max: 1000
+      hidden: true
+    - id: 61
+      name: standby
+      type: boolean
+      hidden: true
+      optional: true
+secondary_entities:
+  - entity: number
+    name: Timer
+    category: config
+    icon: "mdi:timer"
+    dps:
+      - id: 7
+        type: integer
+        name: value
+        unit: min
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+  - entity: select
+    name: Device mode
+    icon: "mdi:lightbulb-auto"
+    category: config
+    dps:
+      - id: 51
+        type: string
+        name: option
+        mapping:
+          - dps_val: auto
+            value: Auto
+          - dps_val: manual
+            value: Manual
+  - entity: binary_sensor
+    class: motion
+    category: diagnostic
+    dps:
+      - id: 52
+        type: string
+        name: sensor
+        optional: true
+        mapping:
+          - dps_val: pir
+            value: true
+          - value: false
+  - entity: select
+    name: Daylight cutoff
+    icon: "mdi:contrast-box"
+    category: config
+    dps:
+      - id: 53
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: "2000lux"
+            value: "Shade"
+          - dps_val: "300lux"
+            value: "Light Cloud"
+          - dps_val: "50lux"
+            value: "Dark Cloud"
+          - dps_val: "10lux"
+            value: "Sunset"
+          - dps_val: "5lux"
+            value: "Twilight"
+  - entity: select
+    name: PIR sensitivity
+    icon: "mdi:motion-sensor"
+    category: config
+    dps:
+      - id: 54
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: low
+            value: Low
+          - dps_val: middle
+            value: Medium
+          - dps_val: high
+            value: High
+  - entity: number
+    name: PIR delay
+    icon: "mdi:camera-timer"
+    category: config
+    dps:
+      - id: 55
+        type: integer
+        name: value
+        optional: true
+        range:
+          min: 5
+          max: 3600
+        unit: s
+  - entity: switch
+    name: Motion detection
+    icon: "mdi:motion-sensor"
+    category: config
+    dps:
+      - id: 56
+        type: boolean
+        name: switch
+  - entity: number
+    name: Standby time
+    category: config
+    icon: "mdi:camera-timer"
+    dps:
+      - id: 58
+        type: integer
+        name: value
+        unit: min
+        optional: true
+        range:
+          min: 1
+          max: 480
+  - entity: switch
+    name: Group sync
+    category: config
+    dps:
+      - id: 60
+        type: boolean
+        name: switch
+  - entity: switch
+    name: Standby
+    icon: "mdi:power-standby"
+    category: config
+    dps:
+      - id: 61
+        type: boolean
+        name: switch
+        optional: true
+        mapping:
+          - dps_val: null
+            value: false
+  - entity: sensor
+    class: battery
+    category: diagnostic
+    dps:
+      - id: 62
+        type: string
+        name: sensor
+        unit: "%"
+        mapping:
+          - dps_val: low
+            value: 20
+          - dps_val: middle
+            value: 50
+          - dps_val: high
+            value: 80
+