Repository: make-all/tuya-local
Pull request #3243: New devices TrueLife Air purrifier P3 and P7
Author: login: Garthcz
Created: 2025-05-15T08:33:25Z | Merged: 2025-05-16T11:05:00Z

Hi, can you add these devices to the project, please. thx


Diff:
diff --git a/custom_components/tuya_local/devices/truelife_air_purrifier_p3.yaml b/custom_components/tuya_local/devices/truelife_air_purrifier_p3.yaml
new file mode 100644
index 00000000000..82d6f76e510
--- /dev/null
+++ b/custom_components/tuya_local/devices/truelife_air_purrifier_p3.yaml
@@ -0,0 +1,114 @@
+name: Air Purifier
+products:
+  - id: pc3mcvhmyfponsqf
+    manufacturer: "TrueLife"
+    model: "Air Purifier P3 WIFI"
+entities:
+  - entity: fan
+    icon: "mdi:air-purifier"
+    translation_only_key: fan_with_presets
+    dps:
+      - id: 1
+        type: boolean
+        name: switch
+      - id: 3
+        name: preset_mode
+        type: string
+        mapping:
+          - dps_val: AUTO
+            value: smart
+          - dps_val: SLEEP
+            value: sleep
+          - dps_val: MANUAL
+            value: manual
+      - id: 4
+        type: string
+        name: speed
+        mapping:
+          - dps_val: LOW
+            value: 33
+          - dps_val: MID
+            value: 66
+          - dps_val: HI
+            value: 100
+  - entity: sensor
+    class: pm25
+    category: diagnostic
+    dps:
+      - id: 2
+        type: integer
+        name: sensor
+        unit: ugm3
+  - entity: switch
+    translation_key: ionizer
+    category: config
+    dps:
+      - id: 6
+        type: boolean
+        name: switch
+  - entity: lock
+    translation_key: child_lock
+    category: config
+    dps:
+      - id: 7
+        type: boolean
+        name: lock
+  - entity: switch
+    translation_key: uv_sterilization
+    category: config
+    dps:
+      - id: 9
+        type: boolean
+        name: switch
+  - entity: button
+    translation_key: filter_reset
+    category: config
+    dps:
+      - id: 11
+        type: boolean
+        name: button
+  - entity: sensor
+    name: Filter Usage
+    icon: "mdi:calendar-clock"
+    category: diagnostic
+    class: duration
+    dps:
+      - id: 16
+        type: integer
+        name: sensor
+        unit: h
+  - entity: select
+    translation_key: timer
+    category: config
+    dps:
+      - id: 19
+        type: string
+        name: option
+        mapping:
+          - dps_val: cancle
+            value: cancel
+          - dps_val: 1H
+            value: 1h
+          - dps_val: 2H
+            value: 2h
+          - dps_val: 3H
+            value: 3h
+          - dps_val: 4H
+            value: 4h
+          - dps_val: 5H
+            value: 5h
+          - dps_val: 6H
+            value: 6h
+          - dps_val: 7H
+            value: 7h
+          - dps_val: 8H
+            value: 8h
+  - entity: sensor
+    translation_key: time_remaining
+    category: diagnostic
+    class: duration
+    dps:
+      - id: 20
+        type: integer
+        name: sensor
+        unit: min
diff --git a/custom_components/tuya_local/devices/truelife_air_purrifier_p7.yaml b/custom_components/tuya_local/devices/truelife_air_purrifier_p7.yaml
new file mode 100644
index 00000000000..6be7b9ef75d
--- /dev/null
+++ b/custom_components/tuya_local/devices/truelife_air_purrifier_p7.yaml
@@ -0,0 +1,114 @@
+name: Air Purifier
+products:
+  - id: lpmzzlrklbkvsizu
+    manufacturer: "TrueLife"
+    model: "Air Purifier P7 WIFI"
+entities:
+  - entity: fan
+    icon: "mdi:air-purifier"
+    translation_only_key: fan_with_presets
+    dps:
+      - id: 1
+        type: boolean
+        name: switch
+      - id: 3
+        name: preset_mode
+        type: string
+        mapping:
+          - dps_val: AUTO
+            value: smart
+          - dps_val: SLEEP
+            value: sleep
+          - dps_val: MANUAL
+            value: manual
+      - id: 4
+        type: string
+        name: speed
+        mapping:
+          - dps_val: LOW
+            value: 33
+          - dps_val: MID
+            value: 66
+          - dps_val: HI
+            value: 100
+  - entity: sensor
+    class: pm25
+    category: diagnostic
+    dps:
+      - id: 2
+        type: integer
+        name: sensor
+        unit: ugm3
+  - entity: switch
+    translation_key: ionizer
+    category: config
+    dps:
+      - id: 6
+        type: boolean
+        name: switch
+  - entity: lock
+    translation_key: child_lock
+    category: config
+    dps:
+      - id: 7
+        type: boolean
+        name: lock
+  - entity: switch
+    translation_key: uv_sterilization
+    category: config
+    dps:
+      - id: 9
+        type: boolean
+        name: switch
+  - entity: button
+    translation_key: filter_reset
+    category: config
+    dps:
+      - id: 11
+        type: boolean
+        name: button
+  - entity: sensor
+    name: Filter Usage
+    icon: "mdi:calendar-clock"
+    category: diagnostic
+    class: duration
+    dps:
+      - id: 16
+        type: integer
+        name: sensor
+        unit: h
+  - entity: select
+    translation_key: timer
+    category: config
+    dps:
+      - id: 18
+        type: string
+        name: option
+        mapping:
+          - dps_val: cancle
+            value: cancel
+          - dps_val: 1h
+            value: 1h
+          - dps_val: 2h
+            value: 2h
+          - dps_val: 3h
+            value: 3h
+          - dps_val: 4h
+            value: 4h
+          - dps_val: 5h
+            value: 5h
+          - dps_val: 6h
+            value: 6h
+          - dps_val: 7h
+            value: 7h
+          - dps_val: 8h
+            value: 8h
+  - entity: sensor
+    translation_key: time_remaining
+    category: diagnostic
+    class: duration
+    dps:
+      - id: 19
+        type: integer
+        name: sensor
+        unit: min


Reviews:
user: login: make-all
state: COMMENTED
author_association: OWNER
submitted_at: 2025-05-15T11:51:19Z

Review comments:
diff_hunk: @@ -0,0 +1,118 @@
+name: Air Purifier
+products:
+  - id: pc3mcvhmyfponsqf
+    manufacturer: "TrueLife"
+    model: "Air Purifier P3 WIFI"
+entities:
+  - entity: fan
+    icon: "mdi:air-purifier"
+    translation_only_key: fan_with_presets
+    dps:
+      - id: 1
+        type: boolean
+        name: switch
+      - id: 3
+        name: preset_mode
+        type: string
+        mapping:
+          - dps_val: AUTO
+            value: smart
+          - dps_val: SLEEP
+            value: sleep
+          - dps_val: MANUAL
+            value: manual
+  - entity: select
path: custom_components/tuya_local/devices/truelife_air_purrifier_p3.yaml
user: login: make-all
body: The fan speed can be merged to the fan entity, with mappings to integers in the 0-100 range.
created_at: 2025-05-15T11:46:15Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,118 @@
+name: Air Purifier
+products:
+  - id: pc3mcvhmyfponsqf
+    manufacturer: "TrueLife"
+    model: "Air Purifier P3 WIFI"
+entities:
+  - entity: fan
+    icon: "mdi:air-purifier"
+    translation_only_key: fan_with_presets
+    dps:
+      - id: 1
+        type: boolean
+        name: switch
+      - id: 3
+        name: preset_mode
+        type: string
+        mapping:
+          - dps_val: AUTO
+            value: smart
+          - dps_val: SLEEP
+            value: sleep
+          - dps_val: MANUAL
+            value: manual
+  - entity: select
+    name: Fan Speed
+    icon: "mdi:fan"
+    category: config
+    dps:
+      - id: 4
+        type: string
+        name: option
+        mapping:
+          - dps_val: LOW
+            value: low
+          - dps_val: MID
+            value: medium
+          - dps_val: HI
+            value: high
+  - entity: sensor
+    class: pm25
+    category: diagnostic
+    dps:
+      - id: 2
+        type: integer
+        name: sensor
+        unit: ugm3
+  - entity: switch
+    translation_key: ionizer
+    category: config
+    dps:
+      - id: 6
+        type: boolean
+        name: switch
+  - entity: lock
+    translation_key: child_lock
+    category: config
+    dps:
+      - id: 7
+        type: boolean
+        name: lock
+  - entity: switch
+    translation_key: uv_sterilization
+    category: config
+    dps:
+      - id: 9
+        type: boolean
+        name: switch
+  - entity: button
+    translation_key: filter_reset
+    category: config
+    dps:
+      - id: 11
+        type: boolean
+        name: button
+  - entity: sensor
+    name: Filter Usage (hours)
path: custom_components/tuya_local/devices/truelife_air_purrifier_p3.yaml
user: login: make-all
body: The unit is already present below, it does not need to be repeated in the entity name. Add `class: duration`
created_at: 2025-05-15T11:47:07Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,118 @@
+name: Air Purifier
+products:
+  - id: pc3mcvhmyfponsqf
+    manufacturer: "TrueLife"
+    model: "Air Purifier P3 WIFI"
+entities:
+  - entity: fan
+    icon: "mdi:air-purifier"
+    translation_only_key: fan_with_presets
+    dps:
+      - id: 1
+        type: boolean
+        name: switch
+      - id: 3
+        name: preset_mode
+        type: string
+        mapping:
+          - dps_val: AUTO
+            value: smart
+          - dps_val: SLEEP
+            value: sleep
+          - dps_val: MANUAL
+            value: manual
+  - entity: select
+    name: Fan Speed
+    icon: "mdi:fan"
+    category: config
+    dps:
+      - id: 4
+        type: string
+        name: option
+        mapping:
+          - dps_val: LOW
+            value: low
+          - dps_val: MID
+            value: medium
+          - dps_val: HI
+            value: high
+  - entity: sensor
+    class: pm25
+    category: diagnostic
+    dps:
+      - id: 2
+        type: integer
+        name: sensor
+        unit: ugm3
+  - entity: switch
+    translation_key: ionizer
+    category: config
+    dps:
+      - id: 6
+        type: boolean
+        name: switch
+  - entity: lock
+    translation_key: child_lock
+    category: config
+    dps:
+      - id: 7
+        type: boolean
+        name: lock
+  - entity: switch
+    translation_key: uv_sterilization
+    category: config
+    dps:
+      - id: 9
+        type: boolean
+        name: switch
+  - entity: button
+    translation_key: filter_reset
+    category: config
+    dps:
+      - id: 11
+        type: boolean
+        name: button
+  - entity: sensor
+    name: Filter Usage (hours)
+    icon: "mdi:calendar-clock"
+    category: diagnostic
+    dps:
+      - id: 16
+        type: integer
+        name: sensor
+        unit: h
+  - entity: select
+    translation_key: timer
+    category: config
+    dps:
+      - id: 19
+        type: string
+        name: option
+        mapping:
+          - dps_val: cancle
+            value: cancel
+          - dps_val: 1H
+            value: 1h
+          - dps_val: 2H
+            value: 2h
+          - dps_val: 3H
+            value: 3h
+          - dps_val: 4H
+            value: 4h
+          - dps_val: 5H
+            value: 5h
+          - dps_val: 6H
+            value: 6h
+          - dps_val: 7H
+            value: 7h
+          - dps_val: 8H
+            value: 8h
+  - entity: sensor
+    name: Timer Remaining
path: custom_components/tuya_local/devices/truelife_air_purrifier_p3.yaml
user: login: make-all
body: Use `translation_key: time_remaining` instead of an explicit name and icon, add `class: duration`
created_at: 2025-05-15T11:47:38Z
author_association: OWNER

PR comments:
user: login: make-all
created_at: 2025-05-16T08:58:22Z
body: Did you mean to close the PR?
author_association: OWNER
user: login: Garthcz
created_at: 2025-05-16T10:32:17Z
body: sorry, I guess I misjudged
author_association: CONTRIBUTOR