Library for controlling Philips air purifiers (using encrypted CoAP)
Project description
aioairctrl
Python library and CLI for controlling Philips air purifiers over the local network using the encrypted CoAP protocol.
Overview
Philips air purifiers (AC series) expose a CoAP endpoint on port 5683 of your local network. This library communicates with that endpoint using an AES-128/CBC encryption scheme reverse-engineered from the Philips app. No cloud connection or account is required.
Supported operations:
- Read the current device status (all sensor readings and settings)
- Observe live status updates as the device pushes them
- Send control commands to change settings
Home Assistant integration If you want to control your Philips air purifier from Home Assistant, see the companion integration: kongo09/philips_airpurifier_coap. It is built on top of this library.
Requirements
- Python 3.12 or newer
- The air purifier must be on the same local network (or otherwise reachable by IP)
Installation
pip install aioairctrl
Command-line usage
All commands require the -H/--host flag with the IP address of your purifier. Find it in your router's DHCP table or the Philips app.
Get current status
aioairctrl -H 192.168.1.100 status
Add --json to get machine-readable output:
aioairctrl -H 192.168.1.100 status --json
Watch for live updates
Stays connected and prints a new line each time the device reports a change (e.g. sensor readings, mode changes):
aioairctrl -H 192.168.1.100 status-observe
aioairctrl -H 192.168.1.100 status-observe --json
Press Ctrl+C to stop.
Set a value
String values:
aioairctrl -H 192.168.1.100 set mode=AG
Boolean values (true/false are handled automatically):
aioairctrl -H 192.168.1.100 set pwr=true
aioairctrl -H 192.168.1.100 set pwr=false
Integer values (use -I/--int):
aioairctrl -H 192.168.1.100 set -I om=2
Multiple values at once:
aioairctrl -H 192.168.1.100 set -I pwr=true om=2
Debug output
Add -D/--debug to any command to see the raw CoAP traffic:
aioairctrl -H 192.168.1.100 --debug status
Python API
import asyncio
from aioairctrl import CoAPClient
async def main():
client = await CoAPClient.create(host="192.168.1.100")
try:
# Read status once
status, max_age = await client.get_status()
print(status)
# Stream live updates
async for status in client.observe_status():
print(status)
break # stop after first update
# Send a command
await client.set_control_value("pwr", True)
# Send multiple values at once
await client.set_control_values({"om": 2, "rhset": 50})
finally:
await client.shutdown()
asyncio.run(main())
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aioairctrl-0.3.1.tar.gz.
File metadata
- Download URL: aioairctrl-0.3.1.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d74feb65d62d9151dc84144cf429fbd6c71994998b093472ec72a0cc1495b57a
|
|
| MD5 |
a0de6a14efe84d02f7e59bedf0bb29f6
|
|
| BLAKE2b-256 |
5d055ab57278e85289fb6fffcb617fb83efd02479ff246d52035f4abf13fbd2d
|
Provenance
The following attestation bundles were made for aioairctrl-0.3.1.tar.gz:
Publisher:
publish.yml on kongo09/aioairctrl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aioairctrl-0.3.1.tar.gz -
Subject digest:
d74feb65d62d9151dc84144cf429fbd6c71994998b093472ec72a0cc1495b57a - Sigstore transparency entry: 1006659647
- Sigstore integration time:
-
Permalink:
kongo09/aioairctrl@cc280461366437be25b05a00952f647ecd974aff -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/kongo09
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cc280461366437be25b05a00952f647ecd974aff -
Trigger Event:
release
-
Statement type:
File details
Details for the file aioairctrl-0.3.1-py3-none-any.whl.
File metadata
- Download URL: aioairctrl-0.3.1-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d20c08bf23112d754e43cd558cc286103dd0aa42d45e4a94929a9705a01244d3
|
|
| MD5 |
a283cfa9e02bb8aa68903ecad488d87e
|
|
| BLAKE2b-256 |
bfc54bb0bd466aba18e93435af56224c2a100e1e14588c4c54b0744d5c944228
|
Provenance
The following attestation bundles were made for aioairctrl-0.3.1-py3-none-any.whl:
Publisher:
publish.yml on kongo09/aioairctrl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aioairctrl-0.3.1-py3-none-any.whl -
Subject digest:
d20c08bf23112d754e43cd558cc286103dd0aa42d45e4a94929a9705a01244d3 - Sigstore transparency entry: 1006659648
- Sigstore integration time:
-
Permalink:
kongo09/aioairctrl@cc280461366437be25b05a00952f647ecd974aff -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/kongo09
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cc280461366437be25b05a00952f647ecd974aff -
Trigger Event:
release
-
Statement type: