Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Kogan air purifier 5 pro #2889

Merged
merged 5 commits into from
Feb 11, 2025
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 162 additions & 0 deletions custom_components/tuya_local/devices/kogan_air_purifier_5_pro.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Protocol 3.4
name: Smart air purifier
products:
- id: bsgh7gwfmazrxsta
manufacturer: Kogan
model: AP-3029UAS
entities:
- entity: fan
translation_only_key: fan_with_presets
dps:
- id: 1
type: boolean
name: switch
- id: 3
type: string
name: preset_mode
mapping:
- dps_val: auto
value: smart
- dps_val: sleep
value: sleep
- dps_val: manual
value: manual
- entity: sensor
class: pm25
dps:
- id: 2
type: integer
name: sensor
unit: ugm3
class: measurement
- name: Preset mode
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to duplicate this

entity: select
category: config
dps:
- id: 3
name: option
type: string
mapping:
- dps_val: auto
value: Smart
- dps_val: sleep
value: Sleep
- dps_val: manual
value: Manual
- name: Fan speed
entity: select
category: config
icon: "mdi:fan"
dps:
- id: 4
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be merged into the fan entity as speed (percentage)

name: option
type: string
mapping:
- dps_val: low
value: Low
- dps_val: mid
value: Medium
- dps_val: high
value: High
- dps_val: turbo
value: Turbo
- name: Filter remaining
entity: sensor
icon: "mdi:shield-bug"
dps:
- id: 5
name: sensor
type: integer
unit: "%"
- name: Child lock
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The standard pattern for child locks is to use a lock entity, with translation_key: child_lock.

entity: switch
category: config
icon: "mdi:lock"
dps:
- id: 7
type: boolean
name: switch
- entity: light
translation_key: indicator
category: config
dps:
- id: 8
type: boolean
name: switch
- translation_key: uv_sterilization
entity: switch
category: config
dps:
- id: 9
type: boolean
name: switch
- translation_key: filter_reset
entity: button
category: config
icon: "mdi:clock-outline"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be no need to override icons for translated entities.

dps:
- id: 11
type: boolean
name: button
optional: true
- name: Timer remaining
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

translation_key: time_remaining

entity: sensor
class: duration
icon: "mdi:clock-outline"
dps:
- id: 20
type: integer
name: sensor
unit: s
- translation_key: air_quality
entity: sensor
class: enum
dps:
- id: 21
name: sensor
type: string
mapping:
- dps_val: great
value: Great
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

air_quality sensors should use values from the translated keys: "excellent", "good", "moderate", "poor", "severe"

- dps_val: good
value: Good
- dps_val: Medium
value: Medium
- dps_val: severe
value: Severe
- class: problem
entity: binary_sensor
category: diagnostic
dps:
- id: 22
type: bitfield
name: sensor
mapping:
- dps_val: 0
value: false
- value: true
- id: 22
type: bitfield
name: fault_code
- name: Filter time
entity: sensor
class: duration
dps:
- id: 101
name: sensor
type: integer
unit: h
mapping:
- scale: 3600
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it has class: duration, there should be no need to scale it. Scaling should be automatic.

- name: Off timer
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

translation_key: timer is probably better. And class: duration should be used.

entity: number
category: config
icon: "mdi:clock-outline"
dps:
- id: 102
type: integer
name: value
unit: m
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit should not be metres. Maybe "min", but "h" seems more likely to me, as a 12 minute off timer seems very short.

range:
min: 0
max: 12