소스 검색

Add support for a 3-in-1 CO2 device (PV28-AW model) (#4460)

* Add support for a 3-in-1 CO2 device. The PV28-AW model. Recognized in Tuya as "CO2_DETECTOR" (all capital letters).

* Address feedback from pull request: Use homeassistant naming style and more specific classes where possible.

* fix (pv28aw_co2detector): rename file and drop name

- rename file to follow standard convention order
- drop the name from battery_charging sensor to allow translations to show

PR #4460

---------

Co-authored-by: Jason Rumney <make-all@users.noreply.github.com>
Jan Dittmer 4 일 전
부모
커밋
51b0aafaf5
1개의 변경된 파일124개의 추가작업 그리고 0개의 파일을 삭제
  1. 124 0
      custom_components/tuya_local/devices/pv28aw_co2detector.yaml

+ 124 - 0
custom_components/tuya_local/devices/pv28aw_co2detector.yaml

@@ -0,0 +1,124 @@
+name: CO2 detector
+entities:
+  - entity: binary_sensor
+    name: CO2 level
+    class: safety
+    dps:
+      - id: 1
+        type: string
+        name: sensor
+        mapping:
+          - dps_val: "alarm"
+            value: true
+          - dps_val: "normal"
+            value: false
+  - entity: sensor
+    class: carbon_dioxide
+    dps:
+      - id: 2
+        type: integer
+        name: sensor
+        unit: ppm
+        class: measurement
+  - entity: number
+    name: CO2 alarm level
+    class: carbon_dioxide
+    category: config
+    dps:
+      - id: 7
+        type: integer
+        name: value
+        optional: true
+        unit: ppm
+        range:
+          min: 800
+          max: 2000
+        mapping:
+          - step: 100
+  - entity: switch
+    name: Alarm enable
+    category: config
+    dps:
+      - id: 13
+        type: boolean
+        name: switch
+        mapping:
+          - dps_val: true
+            icon: "mdi:bell"
+          - dps_val: false
+            icon: "mdi:bell-off"
+  - entity: binary_sensor
+    class: battery_charging
+    category: diagnostic
+    dps:
+      - id: 14
+        type: string
+        name: sensor
+        mapping:
+          - dps_val: normal
+            value: false
+          - dps_val: charge
+            value: true
+  - entity: sensor
+    class: battery
+    category: diagnostic
+    dps:
+      - id: 15
+        type: integer
+        name: sensor
+        unit: "%"
+        class: measurement
+  - entity: sensor
+    class: temperature
+    dps:
+      - id: 18
+        type: integer
+        name: sensor
+        unit: C
+        class: measurement
+  - entity: sensor
+    class: humidity
+    dps:
+      - id: 19
+        type: integer
+        name: sensor
+        unit: "%"
+        class: measurement
+  - entity: select
+    translation_key: temperature_unit
+    category: config
+    dps:
+      - id: 31
+        type: string
+        name: option
+        mapping:
+          - dps_val: c
+            value: celsius
+          - dps_val: f
+            value: fahrenheit
+  - entity: switch
+    name: Screen sleep
+    category: config
+    dps:
+      - id: 101
+        type: boolean
+        name: switch
+        mapping:
+          - dps_val: true
+            icon: "mdi:sleep"
+          - dps_val: false
+            icon: "mdi:sleep-off"
+  - entity: number
+    name: Screen sleep time
+    category: config
+    dps:
+      - id: 102
+        type: integer
+        name: value
+        optional: true
+        unit: s
+        range:
+          min: 10
+          max: 300
+        mapping:
+          - step: 10