Просмотр исходного кода

ZX-M100 presence sensor: sensor is string

The main sensor is a string "presence" or "none", not a boolean.
Looking back at the original report, the information was there then also,
and no log was received showing a boolean, nor was there confirmation from
the reporter that it was working.  I think the assumption was made based on
another device that had recently been encountered that a two option enum in
the cloud protocol would become a boolean in the local protocol.

Also, the distance is missing, as in the original report it was not identified.

Issue #755 (original was #636)
Jason Rumney 2 лет назад
Родитель
Сommit
b1a595e43b
1 измененных файлов с 18 добавлено и 1 удалено
  1. 18 1
      custom_components/tuya_local/devices/zym100_presence_sensor.yaml

+ 18 - 1
custom_components/tuya_local/devices/zym100_presence_sensor.yaml

@@ -7,8 +7,13 @@ primary_entity:
   class: occupancy
   dps:
     - id: 1
-      type: boolean
+      type: string
       name: sensor
+      mapping:
+        - dps_val: presence
+          value: true
+        - dps_val: none
+          value: false
     - id: 101
       type: integer
       name: detection_delay
@@ -79,3 +84,15 @@ secondary_entities:
             value: Timeout
           - dps_val: radar_fault
             value: Radar fault
+  - entity: sensor
+    name: Target distance
+    class: distance
+    category: diagnostic
+    dps:
+      - id: 9
+        type: integer
+        name: sensor
+        unit: m
+        class: measurement
+        mapping:
+          - scale: 100