Преглед изворни кода

Add Smartmi Air Purifier P1 (nedhywwbir5vbypd) (#4212)

* Add Smartmi Air Purifier P1

* Add Smartmi Air Purifier P1 to supported devices list

* Adjust names per review feedback

* Address review feedback

* Fix yamllint line length
HW-YUN пре 1 месец
родитељ
комит
89ea32093f
2 измењених фајлова са 129 додато и 0 уклоњено
  1. 1 0
      DEVICES.md
  2. 128 0
      custom_components/tuya_local/devices/smartmi_air_purifier_p1.yaml

+ 1 - 0
DEVICES.md

@@ -404,6 +404,7 @@
 - Renpho RP-AP001S air purifier
 - Siguro Air Master AP-K50 air purifier
 - Smartmi E1 air purifier
+- Smartmi Air Purifier P1 air purifier
 - Soho SO-350WUI Air Purifier
 - Soleusair A02 and A10 air purifiers
 - Stadler Form Roger air purifier

+ 128 - 0
custom_components/tuya_local/devices/smartmi_air_purifier_p1.yaml

@@ -0,0 +1,128 @@
+# Smartmi Air Purifier P1
+# Category: kj
+# Product ID: nedhywwbir5vbypd
+# Tested with Tuya Local
+
+name: Air purifier
+products:
+  - id: nedhywwbir5vbypd
+    manufacturer: Smartmi
+    model: Air Purifier P1
+
+entities:
+  # -------------------------------------------------------
+  # Fan (On/Off + Preset modes + Speed)
+  # -------------------------------------------------------
+  - entity: fan
+    translation_key: fan_with_presets
+    icon: mdi:air-purifier
+    dps:
+      - id: 1
+        name: switch
+        type: boolean
+
+      # Manual fan level -> fan speed (DP109)
+      - id: 109
+        name: speed
+        type: integer
+        range:
+          min: 1
+          max: 100
+        mapping:
+          - scale: 1
+
+      - id: 3
+        name: preset_mode
+        type: string
+        mapping:
+          # Map HA preset values to defined presets (keep device DP values)
+          - dps_val: auto
+            value: smart
+          - dps_val: sleep
+            value: sleep
+          - dps_val: strong
+            value: strong
+          - dps_val: manual
+            value: normal
+
+  # -------------------------------------------------------
+  # Sensors
+  # -------------------------------------------------------
+  - entity: sensor
+    class: pm25
+    icon: mdi:air-filter
+    dps:
+      - id: 2
+        name: sensor
+        type: integer
+        unit: "µg/m³"
+
+  - entity: sensor
+    name: Filter usage
+    category: diagnostic
+    class: duration
+    icon: mdi:timer-outline
+    dps:
+      - id: 105
+        name: sensor
+        type: integer
+        unit: h
+
+  # -------------------------------------------------------
+  # Timer
+  # -------------------------------------------------------
+  - entity: select
+    translation_key: timer
+    category: config
+    dps:
+      - id: 103
+        name: option
+        type: string
+        mapping:
+          - dps_val: "0_hour"
+            value: cancel
+          - dps_val: "1_hour"
+            value: 1h
+          - dps_val: "2_hour"
+            value: 2h
+          - dps_val: "4_hour"
+            value: 4h
+          - dps_val: "8_hour"
+            value: 8h
+
+  # -------------------------------------------------------
+  # Misc
+  # -------------------------------------------------------
+  - entity: lock
+    translation_key: child_lock
+    category: config
+    dps:
+      - id: 7
+        name: lock
+        type: boolean
+
+  - entity: switch
+    name: Beep
+    category: config
+    dps:
+      - id: 101
+        name: switch
+        type: boolean
+
+  - entity: select
+    name: Display brightness
+    translation_key: mode
+    category: config
+    dps:
+      - id: 110
+        name: option
+        type: string
+        mapping:
+          - dps_val: BRIGHTNESS_HIGH
+            value: high
+          - dps_val: BRIGHTNESS_LOW
+            value: low
+          - dps_val: BRIGHTNESS_OFF
+            value: "off"
+          - dps_val: BRIGHTNESS_AUTO
+            value: auto