https://github.com/maxmudjon/homebridge-mihome-outlet
Homebridge Mihome Outlet
https://github.com/maxmudjon/homebridge-mihome-outlet
apple home homebridge homebridge-mihome-outlet homebridge-plugin homekit mihome miintelligencepinboard miio miplugbase miplugbasewithusb miqingpinboard miqingpinboardwithusb openmihome outlet qing-pinboard
Last synced: 7 months ago
JSON representation
Homebridge Mihome Outlet
- Host: GitHub
- URL: https://github.com/maxmudjon/homebridge-mihome-outlet
- Owner: Maxmudjon
- Created: 2018-04-08T23:02:44.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-08T23:03:11.000Z (over 7 years ago)
- Last Synced: 2025-03-17T10:54:15.559Z (7 months ago)
- Topics: apple, home, homebridge, homebridge-mihome-outlet, homebridge-plugin, homekit, mihome, miintelligencepinboard, miio, miplugbase, miplugbasewithusb, miqingpinboard, miqingpinboardwithusb, openmihome, outlet, qing-pinboard
- Language: JavaScript
- Homepage: https://github.com/Maxmudjon/homebridge-mihome-outlet
- Size: 64.5 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# homebridge-mihome-outlet
[](https://badge.fury.io/js/homebridge-mihome-outlet)XiaoMi outlet plugins for HomeBridge.
Thanks for [nfarina](https://github.com/nfarina)(the author of [homebridge](https://github.com/nfarina/homebridge)), [OpenMiHome](https://github.com/OpenMiHome/mihome-binary-protocol), [aholstenson](https://github.com/aholstenson)(the author of [miio](https://github.com/aholstenson/miio)), all other developer and testers.
**Note: I have only a part of these devices, so some devices don't have tested. If you find bugs, please submit them to [issues](https://github.com/Maxmudjon/homebridge-mihome-outlet/issues).****this plugin uses the miio version 0.15.6 or newer, unlike many other plugins version 0.14.1. Timeouts, API errors are now a thing of the past**




## Supported Devices
1.MiPlugBase
2.MiPlugBaseWithUSB
3.MiIntelligencePinboard
4.MiQingPinboard
5.MiQingPinboardWithUSB
## Installation
1. Install HomeBridge, please follow it's [README](https://github.com/nfarina/homebridge/blob/master/README.md).
If you are using Raspberry Pi, please read [Running-HomeBridge-on-a-Raspberry-Pi](https://github.com/nfarina/homebridge/wiki/Running-HomeBridge-on-a-Raspberry-Pi).
2. Make sure you can see HomeBridge in your iOS devices, if not, please go back to step 1.
3. Install packages.
```
npm install -g homebridge-mihome-outlet
```
## Configuration
### if you only have 'MiPlugBase'
```
"platforms": [{
"platform": "MiHomeOutletPlatform",
"outletDevices": [{
"type": "MiPlugBase",
"ip": "192.168.1.xx",
"token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"outletName": "office room outlet",
"outletDisable": false,
"temperatureName": "office room outlet temperature",
"temperatureDisable": false,
"switchLEDName": "office room led light switch",
"switchLEDDisable": false
}]
}]
```
### if you only have 'MiPlugBaseWithUSB'
```
"platforms": [{
"platform": "MiHomeOutletPlatform",
"outletDevices": [{
"type": "MiPlugBaseWithUSB",
"ip": "192.168.1.xx",
"token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"outletName": "office room outlet",
"outletDisable": false,
"temperatureName": "office room outlet temperature",
"temperatureDisable": false,
"switchUSBName": "office room outlet usb switch",
"switchUSBDisable": false
}]
}]
```
### or use all
```
"platforms": [{
"platform": "MiHomeOutletPlatform",
"outletDevices": [{
"type": "MiPlugBase",
"ip": "192.168.1.xx",
"token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"outletName": "office room outlet",
"outletDisable": false,
"temperatureName": "office room outlet temperature",
"temperatureDisable": false,
"switchLEDName": "office room led light switch",
"switchLEDDisable": false
}, {
"type": "MiPlugBaseWithUSB",
"ip": "192.168.1.xx",
"token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"outletName": "office room outlet",
"outletDisable": false,
"temperatureName": "office room outlet temperature",
"temperatureDisable": false,
"switchUSBName": "office room outlet usb switch",
"switchUSBDisable": false
}, {
"type": "MiIntelligencePinboard",
"ip": "192.168.1.xx",
"token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"outletName": "office room outlet",
"outletDisable": false,
"temperatureName": "office room outlet temperature",
"temperatureDisable": false,
"switchLEDName": "office room led light switch",
"switchLEDDisable": false
}, {
"type": "MiQingPinboard",
"ip": "192.168.1.xx",
"token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"outletName": "office room outlet",
"outletDisable": false,
"temperatureName": "office room outlet temperature",
"temperatureDisable": false
}, {
"type": "MiQingPinboardWithUSB",
"ip": "192.168.1.xx",
"token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"outletName": "office room outlet",
"outletDisable": false,
"temperatureName": "office room outlet temperature",
"temperatureDisable": false
}]
}]
```
## 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](http://miio2.yinhh.com/)], 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.1.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](https://github.com/OpenMiHome/mihome-binary-protocol) and [miio](https://github.com/aholstenson/miio).
## Version Logs
### 0.0.42 (2018-04-09)
1.add support for PlugBase: outlet, temperature sensor, LED switch.
2.add support for PlugBaseWithUSB: outlet, temperature sensor, USB switch.
3.add support for Intelligence Pinboard: outlet, temperature sensor, LED switch.
4.add support for Qing Pinboard: outlet, temperature sensor.
5.add support for Qing Pinboard With USB: outlet, temperature sensor.