ソースを参照

HQL smart radar switch (#6274)

This PR adds a config for the [HQL Smart Radar
Switch](https://www.amazon.com/dp/B0H8MZZVV9).

Most of the entities are pretty typical, however there is an odd set of
DPs that are used to configure whether the switch turns on when motion
is detected and whether it turns off after motion clears.

Those DPs are base64 bitfields, but are not returned from the device
during reads for some reason -- even when I use `force: true`. As such,
I made them a set of button entities that send down the correct base64
values for on vs off for each. Not ideal, but it does the job.

I promise I wrote this PR description by hand -- I just like em-dashes 😉

---------

Co-authored-by: Jason Rumney <make-all@users.noreply.github.com>
Jonathan Keslin 8 時間 前
親
コミット
915e23eebb
1 ファイル変更、116 行追加、0 行削除
  1. 116 0
      custom_components/tuya_local/devices/hql_ds123_radarswitch.yaml

+ 116 - 0
custom_components/tuya_local/devices/hql_ds123_radarswitch.yaml

@@ -0,0 +1,116 @@
+name: Radar switch
+products:
+  - id: k2xfhfqsqbqvbbig
+    manufacturer: HQL
+    model: DS-123
+entities:
+  - entity: switch
+    dps:
+      - id: 1
+        type: boolean
+        name: switch
+
+  - entity: binary_sensor
+    class: occupancy
+    dps:
+      - id: 102
+        type: string
+        name: sensor
+        mapping:
+          - dps_val: presence
+            value: true
+          - value: false
+
+  - entity: number
+    name: Presence delay
+    class: duration
+    category: config
+    icon: "mdi:motion-sensor-off"
+    dps:
+      - id: 103
+        type: integer
+        optional: true
+        name: value
+        unit: s
+        range:
+          min: 5
+          max: 86400
+
+  - entity: number
+    name: Motion sensitivity
+    category: config
+    icon: "mdi:motion-sensor"
+    dps:
+      - id: 104
+        type: integer
+        optional: true
+        name: value
+        range:
+          min: 1
+          max: 25
+
+  - entity: switch
+    name: Motion alarm
+    category: config
+    icon: "mdi:motion-sensor"
+    dps:
+      - id: 105
+        type: boolean
+        name: switch
+
+  - entity: select
+    translation_key: initial_state
+    category: config
+    dps:
+      - id: 14
+        type: string
+        name: option
+        mapping:
+          - dps_val: "off"
+            value: "off"
+          - dps_val: "on"
+            value: "on"
+          - dps_val: memory
+            value: memory
+
+  - entity: select
+    translation_key: light_mode
+    category: config
+    dps:
+      - id: 15
+        type: string
+        name: option
+        mapping:
+          - dps_val: none
+            value: "off"
+          - dps_val: relay
+            value: state
+          - dps_val: pos
+            value: locator
+
+  - entity: light
+    translation_key: backlight
+    category: config
+    dps:
+      - id: 16
+        type: boolean
+        name: switch
+
+  - entity: text
+    name: Presence settings
+    category: config
+    hidden: true
+    dps:
+      - id: 107
+        type: base64
+        optional: true
+        name: value
+  - entity: text
+    name: Absence settings
+    category: config
+    hidden: true
+    dps:
+      - id: 108
+        type: base64
+        optional: true
+        name: value