{"id":15550355,"url":"https://github.com/rgerganov/py-air-control","last_synced_at":"2025-04-04T18:08:25.046Z","repository":{"id":47843238,"uuid":"165268229","full_name":"rgerganov/py-air-control","owner":"rgerganov","description":"Command line app for controlling Philips air purifiers","archived":false,"fork":false,"pushed_at":"2022-01-24T09:45:47.000Z","size":152,"stargazers_count":271,"open_issues_count":41,"forks_count":54,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-04-01T22:14:21.958Z","etag":null,"topics":["air-purifier","air-quality","philips"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rgerganov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-11T15:47:31.000Z","updated_at":"2025-03-04T10:31:47.000Z","dependencies_parsed_at":"2022-08-24T19:31:43.510Z","dependency_job_id":null,"html_url":"https://github.com/rgerganov/py-air-control","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgerganov%2Fpy-air-control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgerganov%2Fpy-air-control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgerganov%2Fpy-air-control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgerganov%2Fpy-air-control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rgerganov","download_url":"https://codeload.github.com/rgerganov/py-air-control/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226215,"owners_count":20904465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["air-purifier","air-quality","philips"],"created_at":"2024-10-02T13:55:55.447Z","updated_at":"2025-04-04T18:08:25.018Z","avatar_url":"https://github.com/rgerganov.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/rgerganov/py-air-control.svg?branch=master)](https://travis-ci.org/rgerganov/py-air-control)\n[![PyPI version](https://badge.fury.io/py/py-air-control.svg)](https://badge.fury.io/py/py-air-control)\n\nCommand line application for controlling Philips air purifiers.\nSupports devices communicating over HTTP, CoAP and encrypted CoAP.\n\nInstallation\n---\nPython 3.4+ is required. Install with `pip3`:\n```\n$ pip3 install py-air-control\n```\nIf your device is using CoAP then update the `CoAPthon3` dependency to get fixes for several known bugs:\n```\n$ pip3 install -U git+https://github.com/rgerganov/CoAPthon3\n```\n\nWi-Fi setup\n---\nThe purifier can be connected to a Wi-Fi network with the following steps:\n\n 1. Put the purifier into pairing mode. On AC2729 this is done by holding the power and child-lock buttons for 3 seconds.\n    The purifier will create an open \"PHILIPS Setup\" wi-fi network.\n 2. Connect your PC to the \"PHILIPS Setup\" network and get IP settings via DHCP. The IP address of the purifier will be 192.168.1.1.\n 3. Now you can re-configure the wi-fi network of the purifier like this:\n```\nairctrl --ipaddr 192.168.1.1 --wifi-ssid \u003cyour_wifi_ssid\u003e --wifi-pwd \u003cyour_wifi_password\u003e\n```\n_Note: this feature is only available for devices that work over HTTP_\n\nUsage in the local network\n---\nGetting the current status of device with IP 192.168.0.17:\n```\n$ airctrl --ipaddr 192.168.0.17\n[pwr]   Power: ON\n[pm25]  PM25: 4\n[rh]    Humidity: 32\n[rhset] Target humidity: 60\n[iaql]  Allergen index: 1\n[temp]  Temperature: 22\n[func]  Function: Purification \u0026 Humidification\n[mode]  Mode: M\n[om]    Fan speed: 2\n[aqil]  Light brightness: 100\n[wl]    Water level: 100\n[cl]    Child lock: False\n```\nYou don't have to specify the IP address (--ipaddr parameter) if there is only one device in your LAN or you want to send commands to all your devices.\nThe IP address will be autodetected using SSDP (UPnP) if the UDP 1900 port is not blocked.\n\nYou can change settings by using the prefix in the square brackets as a command line option.\nFor example to set fan speed 2:\n\n    $ airctrl --om 2\n\nFor AC2889 you may need to specify both manual mode *and* fan speed:\n\n    $ airctrl --mode M --om 2\n\nSet target humidity to 50%:\n\n    $ airctrl --rhset 50\n\nChange function to \"Purification\":\n\n    $ airctrl --func P\n\nPower off the device:\n\n    $ airctrl --pwr 0\n\nand so on\n\nTo get filters status:\n```\n$ airctrl --filters\nPre-filter and Wick: clean in 245 hours\nWick filter: replace in 3965 hours\nActive carbon filter: replace in 1565 hours\nHEPA filter: replace in 3965 hours\n```\n\nSwitching the the communication protocol\n---\nUse --protocol to switch between communication protocols.\nThe following command will try to retrieve the current status using the CoAP protocol with encryption:\n```\n$ airctrl --ipaddr 192.168.0.17 --protocol coap\n```\n\nThe following command will try to retrieve the current status using the CoAP protocol without encryption:\n```\n$ airctrl --ipaddr 192.168.0.17 --protocol plain_coap\n```\n\nRunning without root privileges (Plain CoAP protocol only)\n---\n_Works since Linux kernel 2.6.39._\n\nUse id command to query your group ID:\n```\n$ id -g\n995\n```\n\nThe following command set the range of group IDs that are allowed to create ICMP sockets (ping_group_range kernel parameter, the default is \"1 0\", which means no group is allowed to create ICMP Echo sockets):\n```\n$ sudo sysctl -w net.ipv4.ping_group_range=\"0 1000\"\nnet.ipv4.ping_group_range = 0 1000\n```\n\nMake it permanent:\n```\n$ echo \"net.ipv4.ping_group_range=0 1000\" | sudo tee -a /etc/sysctl.conf\n$ sudo sysctl -p\nnet.ipv4.ping_group_range = 0 1000\n``` \n(see also: https://man7.org/linux/man-pages/man7/icmp.7.html)\n\n\nOutput of different devices\n---\n- For further examples click [here](Examples.md)\n\nUsage via cloud services\n---\nUse the `cloudctrl` script to control your device via the Philips cloud.\n\nFirst you need to find your device id, provision an account and pair the account with the device id:\n```\n$ airctrl --ipaddr 192.168.0.17 --wifi\n{'cppid': '9dcc618e9a82045d',\n...\n$ cloudctrl 9dcc618e9a82045d --pair 192.168.0.17\nCreating cloud account ...\nLogging in with 000000fff0000019\nClient id: 000000fff10d40a1\nClient key: NrIBL02WJNFDICqR6FGKig==\nExchanging secret key with the device ...\nSaving session_key 512735aa3a5dc2608dfa8997b1b03a29 to /home/rgerganov/.pyairctrl\nPairing with 192.168.0.17 ...\n{'return': [0]}\nLogging in with 000000fff10d40a1\nSending pair request to cloud service ...\nRelationship status: completed\n```\nThe pairing needs to be done only once for each device, in the local network of the device.\n\n\nThen you can control the paired device over the internet by using its ID and the account saved in `~/.pyairctrl`:\n```\n$ cloudctrl 9dcc618e9a82045d --pwr 1\nLogging in with 000000fff10d40a1\nSending event {'pwr': '1'} to device with id 9dcc618e9a82045d\n```\n\n_Note: all IDs and credentials above are randomly generated and only used for illustration purposes_\n_Note: this feature is only available for devices that work over HTTP_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgerganov%2Fpy-air-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frgerganov%2Fpy-air-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgerganov%2Fpy-air-control/lists"}