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

Mustool MT15/MT29: fix units

- TVOC is in mg/m³ (which HA does not support, so scaled to µg/m³)
- assume temperature is returned using the configured units

Issue #3209
Jason Rumney 10 месяцев назад
Родитель
Сommit
fc46102713
1 измененных файлов с 12 добавлено и 3 удалено
  1. 12 3
      custom_components/tuya_local/devices/mustool_mt15mt29_airbox.yaml

+ 12 - 3
custom_components/tuya_local/devices/mustool_mt15mt29_airbox.yaml

@@ -24,8 +24,15 @@ entities:
       - id: 2
         type: integer
         name: sensor
-        unit: C
         class: measurement
+      - id: 112
+        type: string
+        optional: true
+        name: unit
+        mapping:
+          - dps_val: f
+            value: F
+          - value: C
   - entity: sensor
     class: humidity
     dps:
@@ -95,15 +102,17 @@ entities:
         name: sensor
   # 28: alarm_volume enum["middle", ???]
   - entity: sensor
-    class: volatile_organic_compounds_parts
+    class: volatile_organic_compounds
     category: diagnostic
     dps:
       - id: 101
         type: integer
         optional: true
         name: sensor
-        unit: ppm
+        unit: µg/m³
         class: measurement
+        mapping:
+          - scale: 1000
   - entity: sensor
     class: carbon_monoxide
     category: diagnostic