Hi everybody,
I’ve found a python command line tool that can control my (and any) Philips air purifier/humidifier. So obviously i want to get that to work from within my home assistant and make it centrally visible and controllable.
Only i have zero programming experience, so i could use some help getting me started, first of all by determining what the right approach is.
This is the command line tool: https://github.com/rgerganov/py-air-control
So basically what the command line tool does is:
- Get the generic status of the purifier (command: $ airctrl 192.168.0.1)
- Get the filter remaining lifetime ( command: $ airctrl 192.168.0.1 --filters)
- send commands to change any of the settings
Generic status is provided in this format:
[pwr] Power: ON
[pm25] PM25: 4
[rh] Humidity: 32
[rhset] Target humidity: 60
[iaql] Allergen index: 1
[temp] Temperature: 22
[func] Function: Purification & Humidification
[mode] Mode: M
[om] Fan speed: 2
[aqil] Light brightness: 100
[wl] Water level: 100
[cl] Child lock: False
Filter status is provided in the following format:
Pre-filter and Wick: clean in 245 hours
Wick filter: replace in 3965 hours
Active carbon filter: replace in 1565 hours
HEPA filter: replace in 3965 hours
Commands can be sent as such, (for example setting target humidity to 60%)
$ airctrl 192.168.0.1 --rhset 50
Now i have found lots HA components that can do pieces of what i want to achieve, for example:
- template fan
- python script
- command line sensor
- shell command
But honestly i don’t really know what would be the proper way to get this up and running.
Can anybody give me some feedback on which components i should be using to:
- query the purifier for statusses (generic + filters)
- interpret the response as individual sensors
- send the purifier commands
If anybody can get me started i’m sure i can do the rest on my own, wrap the whole thing, stick it in a fancy lovelace card and share it with everybody else that wants to control their philips air purifier through home assistant.
Sorry for the long-ass post. Thanks for any help in advance!