Jelajahi Sumber

Add support for C30W gas leak detector

Issue #2676
Jason Rumney 1 tahun lalu
induk
melakukan
168b7231fc
3 mengubah file dengan 115 tambahan dan 1 penghapusan
  1. 1 1
      ACKNOWLEDGEMENTS.md
  2. 1 0
      DEVICES.md
  3. 113 0
      custom_components/tuya_local/devices/c30w_gassensor.yaml

+ 1 - 1
ACKNOWLEDGEMENTS.md

@@ -806,4 +806,4 @@ Further device support has been made with the assistance of users. Please consid
 - [luisolavea](https://github.com/luisolavea) for assisting with support for Zemismart ZMAi-90 energy meter smart switch.
 - [City-Zero](https://github.com/City-Zero) for contributing support for airx H8 humidifier.
 - [rackxp](https://github.com/rackxp) for assisting with support for Brilliant Smart twin flood lights with motion detection.
-
+- [toxacj](https://github.com/toxacj) for assisting with support for C30W gas leak detector.

+ 1 - 0
DEVICES.md

@@ -884,6 +884,7 @@ port and password.
 - Bresser Smart 7-in-1 weather station
 - Bresser Smart Thermo-hygrometer
 - CO2-Box air quality monitor
+- C30W gas leak detector
 - CT20W PIR motion detector
 - EM3390TF weather station (tested with Viflykoo branded device, probably identical to the same model number branded as Uzoli, Jely and others) 
 - Emax EM3378 Weather Station (selling as Hiper P1 and other rebrands)

+ 113 - 0
custom_components/tuya_local/devices/c30w_gassensor.yaml

@@ -0,0 +1,113 @@
+name: Gas leak detector
+products:
+  - id: 4iqe2hsfyd86kwwc
+    model: C30W
+entities:
+  - entity: binary_sensor
+    class: gas
+    dps:
+      - id: 2
+        type: string
+        name: sensor
+        mapping:
+          - dps_val: alarm
+            value: true
+          - value: false
+      - id: 1
+        type: string
+        name: checking_result
+  - entity: number
+    name: Alarm duration
+    class: duration
+    category: config
+    dps:
+      - id: 3
+        type: integer
+        name: value
+        unit: s
+        range:
+          min: 0
+          max: 3600
+  - entity: sensor
+    name: Gas level
+    class: volatile_organic_compounds_parts
+    dps:
+      - id: 5
+        type: integer
+        name: sensor
+        unit: ppm
+        class: measurement
+  - entity: button
+    name: Self test
+    category: config
+    dps:
+      - id: 9
+        type: boolean
+        name: button
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 9
+        type: boolean
+        name: sensor
+  - entity: switch
+    name: Alarm
+    icon: "mdi:bullhorn"
+    category: config
+    dps:
+      - id: 14
+        type: boolean
+        name: switch
+  - entity: number
+    name: Gas alarm threshold
+    category: config
+    class: volatile_organic_compounds_parts
+    dps:
+      - id: 101
+        type: integer
+        name: value
+        unit: ppm
+        range:
+          min: 10
+          max: 100
+  - entity: sensor
+    class: temperature
+    dps:
+      - id: 102
+        type: integer
+        name: sensor
+        unit: C
+        class: measurement
+  - entity: number
+    name: Temperature alarm threshold
+    category: config
+    class: temperature
+    dps:
+      - id: 103
+        type: integer
+        name: value
+        unit: C
+        range:
+          min: -40
+          max: 300
+  - entity: switch
+    name: Temperature alarm
+    icon: "mdi:bullhorn"
+    category: config
+    dps:
+      - id: 104
+        type: string
+        name: switch
+        mapping:
+          - dps_val: upperalarm
+            value: true
+          - dps_val: cancel
+            value: false
+  - entity: light
+    translation_key: backlight
+    category: config
+    dps:
+      - id: 105
+        type: boolean
+        name: switch