Przeglądaj źródła

Add support for 10G 4 in 1 motion sensor (#3740)

* Add support for 10G 4 in 1 motion sensor
* Update label to Exit delay
* feat (motion_sensor_th_light): changes from review
- naming changes
- assume illuminance is in lux, as other units are rare. Use standard class for this sensor
- remove other non-existing units
- use ascii abbreviations for C/F
- use degree without C for relative temperature to avoid conversion issues
* Rename motion_sensor_th_light.yaml to fourin1_motion_sensor.yaml
 - Light is just an indicator, but the original name makes it seem like the main device feature.

PR #3740

---------

Co-authored-by: Jason Rumney <make-all@users.noreply.github.com>
Swar Shah 4 miesięcy temu
rodzic
commit
a8fcc07072

+ 143 - 0
custom_components/tuya_local/devices/fourin1_motion_sensor.yaml

@@ -0,0 +1,143 @@
+name: Motion sensor
+products:
+  - id: e1mwwvns
+    model: 10GHz 4in1
+entities:
+  - entity: binary_sensor
+    class: occupancy
+    dps:
+      - id: 1
+        type: string
+        name: sensor
+        mapping:
+          - dps_val: presence
+            value: true
+          - dps_val: none
+            value: false
+  - entity: number
+    name: Motion sensitivity
+    category: config
+    icon: "mdi:motion-sensor"
+    dps:
+      - id: 2
+        type: integer
+        name: value
+        range:
+          min: 0
+          max: 19
+  - entity: number
+    name: Exit delay
+    category: config
+    class: duration
+    icon: "mdi:timer-outline"
+    dps:
+      - id: 102
+        type: integer
+        name: value
+        unit: s
+        range:
+          min: 5
+          max: 28800
+  - entity: sensor
+    class: temperature
+    dps:
+      - id: 111
+        type: integer
+        name: sensor
+        unit: °
+        mapping:
+          - scale: 10
+        class: measurement
+      - id: 109
+        type: string
+        name: unit
+        mapping:
+          - dps_val: c
+            value: C
+          - dps_val: f
+            value: F
+  - entity: number
+    name: Temperature correction
+    category: config
+    class: temperature
+    icon: "mdi:thermometer-lines"
+    dps:
+      - id: 105
+        type: integer
+        name: value
+        unit: °
+        range:
+          min: -30
+          max: 30
+        mapping:
+          - scale: 10
+            step: 5
+  - entity: select
+    translation_key: temperature_unit
+    category: config
+    dps:
+      - id: 109
+        type: string
+        name: option
+        mapping:
+          - dps_val: c
+            value: celsius
+          - dps_val: f
+            value: fahrenheit
+  - entity: sensor
+    class: humidity
+    dps:
+      - id: 101
+        type: integer
+        name: sensor
+        unit: "%"
+        class: measurement
+  - entity: number
+    name: Humidity calibration
+    category: config
+    icon: "mdi:water-percent"
+    dps:
+      - id: 104
+        type: integer
+        name: value
+        unit: "%"
+        range:
+          min: -10
+          max: 10
+  - entity: sensor
+    translation_key: illuminance
+    dps:
+      - id: 106
+        type: integer
+        name: sensor
+        unit: lx
+        class: measurement
+  - entity: number
+    name: Light sampling interval
+    category: config
+    class: duration
+    icon: "mdi:brightness-5"
+    dps:
+      - id: 107
+        type: integer
+        name: value
+        unit: min
+        range:
+          min: 1
+          max: 480
+  - entity: light
+    translation_key: indicator
+    category: config
+    dps:
+      - id: 108
+        type: boolean
+        name: switch
+  - entity: sensor
+    class: battery
+    category: diagnostic
+    dps:
+      - id: 110
+        type: integer
+        name: sensor
+        unit: "%"
+        class: measurement