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

feat (devices): add support for Digma DiSense G1 gas sensor

Issue #3758
Jason Rumney 4 месяцев назад
Родитель
Сommit
906843915c

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -1071,3 +1071,4 @@ Further device support has been made with the assistance of users. Please consid
 - [mjens118](https://github.com/mjens118) for contributing support for Madimack Eco 9kW heat pump.
 - [TheDarkPreacher](https://github.com/TheDarkPreacher) for assisting with support for Ligency E26 socket ceiling fan with RGBCW light.
 - [3ek](https://github.com/3ek) for contributing support for Motorized pop-up smart sockets.
+- [den4ikmega](https://github.com/den4ikmega) for assisting with support for Digma DiSense G1 gas leak detector.

+ 1 - 0
DEVICES.md

@@ -1036,6 +1036,7 @@ port and password.
 - C30W gas leak detector
 - CT20W PIR motion detector
 - Dienmern DM165A noise meter
+- Digma DiSense G1 gas leak detector
 - E Chief SGH01 hydroponic planter
 - 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)

+ 112 - 0
custom_components/tuya_local/devices/digma_disenseg1_gassensor.yaml

@@ -0,0 +1,112 @@
+name: Gas leak detector
+# products:
+#   - id: UNKNOWN
+#     manufacturer: Digma
+#     model: DiSense G1
+entities:
+  - entity: sensor
+    name: Self-check result
+    class: enum
+    category: diagnostic
+    dps:
+      - id: 1
+        type: string
+        optional: true
+        name: sensor
+        mapping:
+          - dps_val: null
+            value: unchecked
+          - dps_val: checking
+            value: checking
+          - dps_val: check_success
+            value: success
+          - dps_val: check_failure
+            value: failure
+          - dps_val: others
+            value: other
+  - entity: binary_sensor
+    class: gas
+    dps:
+      - id: 2
+        type: string
+        name: sensor
+        mapping:
+          - dps_val: alarm
+            value: true
+          - value: false
+  - entity: number
+    name: Alarm duration
+    class: duration
+    category: config
+    dps:
+      - id: 3
+        type: integer
+        name: value
+        unit: s
+        range:
+          min: 0
+          max: 60
+  - entity: sensor
+    class: volatile_organic_compounds_parts
+    category: diagnostic
+    dps:
+      - id: 5
+        type: integer
+        name: sensor
+        unit: ppm
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: button
+    name: Self check
+    category: config
+    dps:
+      - id: 9
+        type: boolean
+        optional: true
+        name: button
+  - entity: binary_sensor
+    class: cold
+    category: diagnostic
+    dps:
+      - id: 10
+        type: boolean
+        name: sensor
+  - entity: button
+    name: Mute
+    category: config
+    dps:
+      - id: 14
+        type: boolean
+        optional: true
+        name: button
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 45
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 45
+        type: bitfield
+        name: fault_code
+      - id: 45
+        type: bitfield
+        name: description
+        mapping:
+          - dps_val: 0
+            value: ok
+          - dps_val: 1
+            value: fault
+          - dps_val: 2
+            value: serious_fault
+          - dps_val: 4
+            value: sensor_fault
+          - dps_val: 8
+            value: probe_fault
+          - dps_val: 16
+            value: power_fault