Domoticz plugin for Xiaomi AirPurifier 2/2S


pip3 install -U python-miio
git clone

First use script “” to verify if you have needed python modules

./ 850000000000000000000000002 --debug
./ -h
usage: [-h] [--mode {Auto,Favorite,Idle,Silent}]
                [--favoriteLevel {0,1,2,3,4,5,6,7,8,9,10}] [--power {ON,OFF}]
                IPaddress token

Script which comunicate with AirPurfier 2/2S.

positional arguments:
  IPaddress             IP address of AirPurfier
  token                 token to login to device

optional arguments:
  -h, --help            show this help message and exit
  --mode {Auto,Favorite,Idle,Silent}
                        choose mode operation
  --favoriteLevel {0,1,2,3,4,5,6,7,8,9,10}
                        choose mode operation
  --power {ON,OFF}      power ON/OFF
  --debug               if define more output is printed
  --led {ON,OFF}        turn led on/off
  • check where modules was installed and in file find and correct below variable (in my case 2 instances) if needed

Restart Domoticz

  • Go to Setup > Hardware and create new Hardware with type: AirPurfier
  • Enter name (it’s up to you), user name and password if define. If not leave it blank


cd YOUR_DOMOTICZ_PATH/plugins/domoticz-AirPurifier
git pull


In case of issues, mostly plugin not visible on plugin list, check logs if plugin system is working correctly. See Domoticz wiki for resolution of most typical installation issues