Skip to main content

Programmatically control the Winix C545

Project description

Winix Controller

This is a Python library for controlling Winix C545 Air Purifier devices. I reverse-engineered the API calls from the Android app. There are a few weird idiosyncrasies with the Winix backends.

Included in this package is a CLI program winixctl.

Setup

Install using PyPI: pip install winix. You then have access to the winix module in python as well as the winixctl command for shell (which uses the library).

winixctl CLI

$ winixctl
usage: winixctl [-h] [--device DEVICE_SELECTOR] {login,refresh,devices,getstate,fan,power,mode,plasmawave} ...

Winix C545 Air Purifier Control

positional arguments:
  {login,refresh,devices,getstate,fan,power,mode,plasmawave}
    login               Authenticate Winix account
    refresh             Refresh account device metadata
    devices             List registered Winix devices
    getstate            Get device state
    fan                 Fan speed controls
    power               Power controls
    mode                Mode controls
    plasmawave          Plasmawave controls

optional arguments:
  -h, --help            show this help message and exit
  --device DEVICE_SELECTOR, -D DEVICE_SELECTOR
                        Device Index/Mac/Alias to use

In order to control your device, you first must run winixctl login. this will save a token from the Winix backend in a file on your system at ~/config/winix/config.json. It will prompt you for a username and password. You can use the --username and --password flags as well.

You can see the devives registered to your winix account with winixctl devices.

~/dev/winix(master*) » winixctl devices
1 devices:
Device#0 (default) -------------------------------
      Device ID : 123456abcde_********** (hidden)
            Mac : 123456abcde
          Alias : Bedroom
       Location : SROU

Missing a device? You might need to run refresh.

The last portion of the Device ID is hidden as it can be used to control the device.

Multi-device Support

By default the commands will work on the first device you have in your Winix account. If you have multiple air purifiers, you can specify which device to use by specifying a value for the top-level --device flag (short: -D).

You may specify one of:

  • The device index. Example: 0 (the default device selector).
  • The device mac. Example: 123456abcde. Mac values stay the same between device registration. If you have a device that you move between Wifi networks frequently then you will want to use this.
  • The device alias. Example: bedroom. This is the most human-friendly version.

Examples

Turn off the bedroom air purifier using an alias as the selector:

winixctl -D bedroom power off

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

winix-0.3.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

winix-0.3.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file winix-0.3.0.tar.gz.

File metadata

  • Download URL: winix-0.3.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.2

File hashes

Hashes for winix-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b848f0823c995e9e82dbcf62439322867521a979af2ba22582f554b5830836ac
MD5 1c975b0f81b31aa178c103e3f0886064
BLAKE2b-256 d0acabc514a6f1fb4fc9f15bb50c059d311c1da7a48a59fd2054590c6c37df02

See more details on using hashes here.

File details

Details for the file winix-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: winix-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.2

File hashes

Hashes for winix-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a0d52979e3076ed0a09b9a084fc472dcede39892c9797fdf24088072af503824
MD5 f2c3cfb0ac51157ffaa1c59e4172db12
BLAKE2b-256 a47e986fef7facd7cc6e7891aa548b1a48c6713392d1f444e129e0a024ab14fb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page