Homebridge plugin for controlling Xiaomi Air Purifier 3/3H
npm install -g homebridge
npm install -g homebridge-xiaomi-air-purifier3
"accessories": [
{
"accessory": "XiaomiAirPurifier3",
"name": "Xiaomi Air Purifier",
"did": "XXXXXXXXX",
"ip": "10.0.X.X",
"token": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"pm25_breakpoints": [5, 12, 35, 55]
}
]
IMPORTANT: I recommend that you assign a static ip address in order to avoid having your router change the ip address of the device on reboot or when the lease expires.
Is install the miio npm package
npm install -g miio
Make sure your computer is on the same network with your air purifier, then run following command.
miio discover
You may need to wait few minutes until you get the response similar to below:
Device ID: 127261362
Model info: Unknown
Address: 10.0.1.3
Token: ???
Support: Unknown
This is no so straight forward but it shouldn't be to hard either. I don't plan to keep and updated tutorial on this but there a lot of good ones online so you can use google to find them.
A very comprehensive one can be found here
In the default Home App, automations are limited to air quality sensor's reported AQI and not on the numeric PM2.5 density.
HomeKit has 5 values for air quality. The air quality sensor will switch between them based on the current PM2.5 density:
You can define your own limits by using the pm25_breakpoints option:
"pm25_breakpoints": [5, 12, 35, 55]
NOTE: You can use 3rd party apps like EveHome or Home+ if you want to create PM2.5 triggered automations.