homebridge-xiaomi-airpurifiers v1.0.2
homebridge-xiaomi-airpurifiers
Xiaomi air purifier plugins for HomeBridge.
Supported Devices
1.MiAirPurifier(小米空气净化器)
2.MiAirPurifier2(小米空气净化器2)
3.MiAirPurifierPro(小米空气净化器Pro)
4.MiAirPurifier2S(小米空气净化器2S)
5.MiAirPurifier3(小米空气净化器3/3H)
Pre-Requirements
1.Make sure your IOS version is ios11 or later.
Installation
- Install HomeBridge, please follow it's README.
If you are using Raspberry Pi, please read Running-HomeBridge-on-a-Raspberry-Pi. - Make sure you can see HomeBridge in your iOS devices, if not, please go back to step 1.
- Install packages.
npm install -g homebridge-xiaomi-airpurifiers
Configuration
"platforms": [{
"platform": "MiAirPurifierPlatform",
"deviceCfgs": [{
"type": "MiAirPurifier3",
"ip": "192.168.88.xx",
"token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"airPurifierDisable": false,
"airPurifierName": "Air Purifier 3/3H",
"did": "xxxxxxxxx",
"pm25_breakpoints" : [
5,
12,
35,
55
]
}, {
"type": "MiAirPurifierPro",
"ip": "192.168.88.xx",
"token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"airPurifierDisable": false,
"airPurifierName": "Air Purifier Pro",
"did": "xxxxxxxxx",
"pm25_breakpoints" : [
5,
12,
35,
55
]
}]
}]
Get token
Get token by miio2.db
setup MiJia(MiHome) app in your android device or android virtual machine.
open MiJia(MiHome) app and login your account.
refresh device list and make sure device display in the device list.
get miio2.db(path: /data/data/com.xiaomi.smarthome/databases/miio2.db) file from your android device or android virtual machine.
open website [Get MiIo Tokens By DataBase File], upload miio2.db file and submit.
Get token by network
Open command prompt or terminal. Run following command:
miio --discover
Wait until you get output similar to this:
Device ID: xxxxxxxx
Model info: Unknown
Address: 192.168.88.xx
Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx via auto-token
Support: Unknown
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" is token.
If token is "???", then reset device and connect device created Wi-Fi hotspot.
Run following command:
miio --discover --sync
Wait until you get output.
For more information about token, please refer to OpenMiHome and miio.