项目作者: Maxmudjon

项目描述 :
Homebridge Mihome Outlet
高级语言: JavaScript
项目地址: git://github.com/Maxmudjon/homebridge-mihome-outlet.git
创建时间: 2018-04-08T23:02:44Z
项目社区:https://github.com/Maxmudjon/homebridge-mihome-outlet

开源协议:

下载


homebridge-mihome-outlet

npm version

XiaoMi outlet plugins for HomeBridge.

Thanks for nfarina(the author of homebridge), OpenMiHome, aholstenson(the author of 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.

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.
    If you are using Raspberry Pi, please read 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.
    1. npm install -g homebridge-mihome-outlet

    Configuration

    if you only have ‘MiPlugBase’

    1. "platforms": [{
    2. "platform": "MiHomeOutletPlatform",
    3. "outletDevices": [{
    4. "type": "MiPlugBase",
    5. "ip": "192.168.1.xx",
    6. "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    7. "outletName": "office room outlet",
    8. "outletDisable": false,
    9. "temperatureName": "office room outlet temperature",
    10. "temperatureDisable": false,
    11. "switchLEDName": "office room led light switch",
    12. "switchLEDDisable": false
    13. }]
    14. }]

    if you only have ‘MiPlugBaseWithUSB’

    1. "platforms": [{
    2. "platform": "MiHomeOutletPlatform",
    3. "outletDevices": [{
    4. "type": "MiPlugBaseWithUSB",
    5. "ip": "192.168.1.xx",
    6. "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    7. "outletName": "office room outlet",
    8. "outletDisable": false,
    9. "temperatureName": "office room outlet temperature",
    10. "temperatureDisable": false,
    11. "switchUSBName": "office room outlet usb switch",
    12. "switchUSBDisable": false
    13. }]
    14. }]

    or use all

    1. "platforms": [{
    2. "platform": "MiHomeOutletPlatform",
    3. "outletDevices": [{
    4. "type": "MiPlugBase",
    5. "ip": "192.168.1.xx",
    6. "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    7. "outletName": "office room outlet",
    8. "outletDisable": false,
    9. "temperatureName": "office room outlet temperature",
    10. "temperatureDisable": false,
    11. "switchLEDName": "office room led light switch",
    12. "switchLEDDisable": false
    13. }, {
    14. "type": "MiPlugBaseWithUSB",
    15. "ip": "192.168.1.xx",
    16. "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    17. "outletName": "office room outlet",
    18. "outletDisable": false,
    19. "temperatureName": "office room outlet temperature",
    20. "temperatureDisable": false,
    21. "switchUSBName": "office room outlet usb switch",
    22. "switchUSBDisable": false
    23. }, {
    24. "type": "MiIntelligencePinboard",
    25. "ip": "192.168.1.xx",
    26. "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    27. "outletName": "office room outlet",
    28. "outletDisable": false,
    29. "temperatureName": "office room outlet temperature",
    30. "temperatureDisable": false,
    31. "switchLEDName": "office room led light switch",
    32. "switchLEDDisable": false
    33. }, {
    34. "type": "MiQingPinboard",
    35. "ip": "192.168.1.xx",
    36. "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    37. "outletName": "office room outlet",
    38. "outletDisable": false,
    39. "temperatureName": "office room outlet temperature",
    40. "temperatureDisable": false
    41. }, {
    42. "type": "MiQingPinboardWithUSB",
    43. "ip": "192.168.1.xx",
    44. "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    45. "outletName": "office room outlet",
    46. "outletDisable": false,
    47. "temperatureName": "office room outlet temperature",
    48. "temperatureDisable": false
    49. }]
    50. }]

    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:
    1. miio --discover
    Wait until you get output similar to this:
    1. Device ID: xxxxxxxx
    2. Model info: Unknown
    3. Address: 192.168.1.xx
    4. Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx via auto-token
    5. Support: Unknown
    “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx” is token.
    If token is “???”, then reset device and connect device created Wi-Fi hotspot.
    Run following command:
    1. miio --discover --sync
    Wait until you get output.
    For more information about token, please refer to OpenMiHome and 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.