Jelajahi Sumber

Weaja gas alarm: improvements from testing

- alarm time is min in app, even though protocol level docs say s.
- standardize % LEL with a space (also ZX GS21), like Haier sensor.

Issue #2434
Jason Rumney 1 tahun lalu
induk
melakukan
efd46a3bc5

+ 11 - 14
custom_components/tuya_local/devices/weaja_s9_gasalarm.yaml

@@ -1,7 +1,7 @@
 name: Gas alarm
-products:
-  - id: UNKNOWN
-    name: Weaja WJ-TUYA-S9
+# products:
+#   - id: UNKNOWN
+#     name: Weaja WJ-TUYA-S9
 primary_entity:
   entity: binary_sensor
   class: gas
@@ -23,7 +23,7 @@ secondary_entities:
         type: integer
         optional: true
         name: value
-        unit: s
+        unit: min
         range:
           min: 0
           max: 60
@@ -31,6 +31,12 @@ secondary_entities:
           - dps_val: null
             value: 0
             hidden: true
+        # dp 12 is labelled as switch_alarm, but does not appear to work, so
+        # possibly just an indicator of some sort. Left as an attribute until
+        # it can be figured out.
+      - id: 12
+        type: boolean
+        name: switch
   - entity: sensor
     name: Gas
     icon: "mdi:fire"
@@ -38,8 +44,7 @@ secondary_entities:
       - id: 5
         type: integer
         name: sensor
-        # image on website shows %LEL, but tuya docs say ppm
-        unit: "%LEL"
+        unit: "% LEL"
         class: measurement
         mapping:
           - scale: 10
@@ -54,14 +59,6 @@ secondary_entities:
           - dps_val: alarm
             value: true
           - value: false
-  - entity: switch
-    name: Alarm
-    icon: "mdi:bullhorn"
-    category: config
-    dps:
-      - id: 12
-        type: boolean
-        name: switch
   - entity: button
     name: Mute
     category: config

+ 1 - 1
custom_components/tuya_local/devices/zx_gs21_gasmonitor.yaml

@@ -10,7 +10,7 @@ primary_entity:
     - id: 2
       type: integer
       name: sensor
-      unit: "%LEL"
+      unit: "% LEL"
       class: measurement
     - id: 1
       type: string