Explorar el Código

Mustool MT15/29: corrections and additions from cloud data

Issue #3209 had the log message from cloud fully describing some dps,
allowing Formaldehyde sensor scale and Alarm volume options to be clarified.

- cloud docs say scale is 3 (decimal places), which along with mg/m³ units
  means there should be no scaling needed with µg/m³ units
- cloud docs give the list of options for alarm volume so a select entity can
  be created for that.

Also range information from the app allows alarm threshold entities to
be created.
Jason Rumney hace 9 meses
padre
commit
f71985fc6f
Se han modificado 1 ficheros con 85 adiciones y 13 borrados
  1. 85 13
      custom_components/tuya_local/devices/mustool_mt15mt29_airbox.yaml

+ 85 - 13
custom_components/tuya_local/devices/mustool_mt15mt29_airbox.yaml

@@ -58,8 +58,6 @@ entities:
         name: sensor
         name: sensor
         unit: µg/m³
         unit: µg/m³
         class: measurement
         class: measurement
-        mapping:
-          - scale: 0.001
   - entity: sensor
   - entity: sensor
     class: pm25
     class: pm25
     dps:
     dps:
@@ -100,7 +98,24 @@ entities:
       - id: 23
       - id: 23
         type: boolean
         type: boolean
         name: sensor
         name: sensor
-  # 28: alarm_volume enum["middle", ???]
+  - entity: select
+    name: Alarm volume
+    icon: "mdi:bullhorn"
+    category: config
+    dps:
+      - id: 28
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: low
+            value: low
+          - dps_val: middle
+            value: medium
+          - dps_val: high
+            value: high
+          - dps_val: mute
+            value: mute
   - entity: sensor
   - entity: sensor
     class: volatile_organic_compounds
     class: volatile_organic_compounds
     category: diagnostic
     category: diagnostic
@@ -111,8 +126,6 @@ entities:
         name: sensor
         name: sensor
         unit: µg/m³
         unit: µg/m³
         class: measurement
         class: measurement
-        mapping:
-          - scale: 0.001
   - entity: sensor
   - entity: sensor
     class: carbon_monoxide
     class: carbon_monoxide
     category: diagnostic
     category: diagnostic
@@ -124,8 +137,33 @@ entities:
         unit: ppm
         unit: ppm
         class: measurement
         class: measurement
   # 103: bl_level enum["level_1", ???]
   # 103: bl_level enum["level_1", ???]
-  # 104: co2_alarm_value int, unknown range
-  # 105: sleep_timer int, unknown range
+  - entity: number
+    name: CO2 alarm threshold
+    category: config
+    class: carbon_dioxide
+    dps:
+      - id: 104
+        type: integer
+        optional: true
+        name: value
+        unit: ppm
+        range:
+          min: 500
+          max: 3000
+  - entity: number
+    name: Sleep timer
+    category: config
+    class: duration
+    icon: "mdi:bed-clock"
+    dps:
+      - id: 105
+        type: integer
+        optional: true
+        name: value
+        unit: min
+        range:
+          min: 0
+          max: 100
   - entity: switch
   - entity: switch
     icon: "mdi:sprout"
     icon: "mdi:sprout"
     name: Enable alarm
     name: Enable alarm
@@ -147,12 +185,6 @@ entities:
   # 109: clock1 int, unknown range or purpose
   # 109: clock1 int, unknown range or purpose
   # 110: clock2 int, unknown range or purpose
   # 110: clock2 int, unknown range or purpose
   # 111: clock3 int, unknown range or purpose
   # 111: clock3 int, unknown range or purpose
-  # 113: co_alarm_value int, unknown range
-  # 114: pm25_alarm_value int, unknown range
-  # 115: hcho_alarm_value int, unknown range
-  # 116: clock1_en bool, unknown purpose
-  # 117: clock2_en bool, unknown purpose
-  # 118: clock3_en bool, unknown purpose
   - entity: select
   - entity: select
     translation_key: temperature_unit
     translation_key: temperature_unit
     category: config
     category: config
@@ -166,3 +198,43 @@ entities:
             value: celsius
             value: celsius
           - dps_val: f
           - dps_val: f
             value: fahrenheit
             value: fahrenheit
+  - entity: number
+    name: CO alarm threshold
+    class: carbon_monoxide
+    category: config
+    dps:
+      - id: 113
+        type: integer
+        optional: true
+        name: value
+        unit: ppm
+        range:
+          min: 10
+          max: 500
+  - entity: number
+    name: PM2.5 alarm threshold
+    category: config
+    class: pm25
+    dps:
+      - id: 114
+        type: integer
+        name: value
+        unit: µg/m³
+        range:
+          min: 50
+          max: 300
+  # 116: clock1_en bool, unknown purpose
+  # 117: clock2_en bool, unknown purpose
+  # 118: clock3_en bool, unknown purpose
+  - entity: number
+    name: Formaldehyde alarm threshold
+    category: config
+    icon: "mdi:alert"
+    dps:
+      - id: 115
+        type: integer
+        name: value
+        unit: µg/m³
+        range:
+          min: 80
+          max: 1990