{"id":15018236,"url":"https://github.com/yinhangcode/homebridge-mi-outlet","last_synced_at":"2025-10-23T17:31:14.919Z","repository":{"id":57265634,"uuid":"101204151","full_name":"YinHangCode/homebridge-mi-outlet","owner":"YinHangCode","description":"XiaoMi outlet plugins for HomeBridge.","archived":false,"fork":false,"pushed_at":"2020-08-22T12:29:50.000Z","size":109,"stargazers_count":79,"open_issues_count":21,"forks_count":16,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-09T22:03:39.252Z","etag":null,"topics":["homebridge","homebridge-plugin","mi","mijia","outlet","plug","qingmi","xiaomi","zhimi"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YinHangCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-23T16:52:01.000Z","updated_at":"2024-09-08T16:47:32.000Z","dependencies_parsed_at":"2022-08-25T03:40:37.950Z","dependency_job_id":null,"html_url":"https://github.com/YinHangCode/homebridge-mi-outlet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YinHangCode%2Fhomebridge-mi-outlet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YinHangCode%2Fhomebridge-mi-outlet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YinHangCode%2Fhomebridge-mi-outlet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YinHangCode%2Fhomebridge-mi-outlet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YinHangCode","download_url":"https://codeload.github.com/YinHangCode/homebridge-mi-outlet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219868069,"owners_count":16555808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["homebridge","homebridge-plugin","mi","mijia","outlet","plug","qingmi","xiaomi","zhimi"],"created_at":"2024-09-24T19:51:43.017Z","updated_at":"2025-10-23T17:31:14.570Z","avatar_url":"https://github.com/YinHangCode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# homebridge-mi-outlet\n[![npm version](https://badge.fury.io/js/homebridge-mi-outlet.svg)](https://badge.fury.io/js/homebridge-mi-outlet)\n\nXiaoMi outlet plugins for HomeBridge.   \n   \nThanks 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.   \n   \n**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/YinHangCode/homebridge-mi-outlet/issues) or [QQ Group: 107927710](//shang.qq.com/wpa/qunwpa?idkey=8b9566598f40dd68412065ada24184ef72c6bddaa11525ca26c4e1536a8f2a3d).**   \n\n![](https://raw.githubusercontent.com/YinHangCode/homebridge-mi-outlet/master/images/PlugBase.jpg)\n![](https://raw.githubusercontent.com/YinHangCode/homebridge-mi-outlet/master/images/PlugBaseWithUSB.jpg)\n![](https://raw.githubusercontent.com/YinHangCode/homebridge-mi-outlet/master/images/IntelligencePinboard.jpg)\n![](https://raw.githubusercontent.com/YinHangCode/homebridge-mi-outlet/master/images/QingPinboard.jpg)\n![](https://raw.githubusercontent.com/YinHangCode/homebridge-mi-outlet/master/images/QingPinboardWithUSB.jpg)\n![](https://raw.githubusercontent.com/YinHangCode/homebridge-mi-outlet/master/images/MiPlugBaseEnhanced.jpg)\n\n## Supported Devices\n1. MiPlugBase(米家智能插座基础版)   \n2. MiPlugBaseWithUSB(小米智能插座_USB版)   \n3. MiIntelligencePinboard(米家智能插线板)   \n4. MiQingPinboard(青米智能插线板_五孔位版)   \n5. MiQingPinboardWithUSB(青米智能插线板_USB版)   \n6. MiPlugBaseEnhanced(米家智能插座增强版)   \n\n## Installation\n1. Install HomeBridge, please follow it's [README](https://github.com/nfarina/homebridge/blob/master/README.md).   \nIf 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).   \n2. Make sure you can see HomeBridge in your iOS devices, if not, please go back to step 1.   \n3. Install packages.   \n```\nnpm install -g homebridge-mi-outlet\n```\n## Configuration\n```\n\"platforms\": [{\n    \"platform\": \"MiOutletPlatform\",\n    \"deviceCfgs\": [{\n        \"type\": \"MiPlugBase\",\n        \"ip\": \"192.168.88.xx\",\n        \"token\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n        \"outletName\": \"living room outlet\",\n        \"outletDisable\": false,\n        \"temperatureName\": \"living room outlet temperature\",\n        \"temperatureDisable\": false,\n        \"switchLEDName\": \"living room led light switch\",\n        \"switchLEDDisable\": true\n    }, {\n        \"type\": \"MiPlugBaseWithUSB\",\n        \"ip\": \"192.168.88.xx\",\n        \"token\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n        \"outletName\": \"study room outlet\",\n        \"outletDisable\": false,\n        \"temperatureName\": \"study room outlet temperature\",\n        \"temperatureDisable\": false,\n        \"switchUSBName\": \"study room outlet usb switch\",\n        \"switchUSBDisable\": false\n    }, {\n        \"type\": \"MiIntelligencePinboard\",\n        \"ip\": \"192.168.88.xx\",\n        \"token\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n        \"outletName\": \"master room outlet\",\n        \"outletDisable\": false,\n        \"temperatureName\": \"master room outlet temperature\",\n        \"temperatureDisable\": false,\n        \"switchLEDName\": \"master room led light switch\",\n        \"switchLEDDisable\": true\n    }, {\n        \"type\": \"MiQingPinboard\",\n        \"ip\": \"192.168.88.xx\",\n        \"token\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n        \"outletName\": \"dining room outlet\",\n        \"outletDisable\": false,\n        \"temperatureName\": \"dining room outlet temperature\",\n        \"temperatureDisable\": false\n    }, {\n        \"type\": \"MiQingPinboardWithUSB\",\n        \"ip\": \"192.168.88.xx\",\n        \"token\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n        \"outletName\": \"kitchen room outlet\",\n        \"outletDisable\": false,\n        \"temperatureName\": \"kitchen room outlet temperature\",\n        \"temperatureDisable\": false\n    }, {\n        \"type\": \"MiPlugBaseEnhanced\",\n        \"ip\": \"192.168.88.xx\",\n        \"token\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n        \"outletName\": \"living room outlet2\",\n        \"outletDisable\": false,\n        \"temperatureName\": \"living room outlet2 temperature\",\n        \"temperatureDisable\": false,\n        \"switchUSBName\": \"living room outlet2 usb switch\",\n        \"switchUSBDisable\": false,\n        \"switchLEDName\": \"living room outlet2 led light switch\",\n        \"switchLEDDisable\": true\n    }]\n}]\n```\n## Get token\n### Get token by miio2.db (Recommend)\nsetup MiJia(MiHome) app in your android device or android virtual machine.   \nopen MiJia(MiHome) app and login your account.   \nrefresh device list and make sure device display in the device list.   \nget miio2.db(path: /data/data/com.xiaomi.smarthome/databases/miio2.db) file from your android device or android virtual machine.   \nopen website [[Get MiIo Tokens By DataBase File](http://miio2.yinhh.com/)], upload miio2.db file and submit.    \n### Get token by network\nOpen command prompt or terminal. Run following command:\n```\nmiio --discover\n```\nWait until you get output similar to this:\n```\nDevice ID: xxxxxxxx   \nModel info: Unknown   \nAddress: 192.168.88.xx   \nToken: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx via auto-token   \nSupport: Unknown   \n```\n\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\" is token.   \nIf token is \"???\", then reset device and connect device created Wi-Fi hotspot.   \nRun following command:   \n```\nmiio --discover --sync\n```\nWait until you get output.   \nFor more information about token, please refer to [OpenMiHome](https://github.com/OpenMiHome/mihome-binary-protocol) and [miio](https://github.com/aholstenson/miio).   \n## Version Logs\n### 0.3.0 (2018-09-10)\n1. add support for Mi PlugBase Enhanced: outlet, temperature sensor, LED switch, USB switch.   \n### 0.2.8 (2018-02-10)\n1. update 'package.json'.   \n### 0.2.7 (2017-11-18)\n1. modify class name, reduce the probability of conflicts due to the same class name and other plugins.   \n### 0.2.6 (2017-09-11)\n1. optimized code.   \n### 0.2.5 (2017-09-05)\n1. optimized code.   \n### 0.2.4 (2017-08-31)\n1. add outlet inuse display.    \n### 0.2.3 (2017-08-30)\n1. fixed bug that 'log of undefined' error.    \n2. config item 'accessories' renamed 'deviceCfgs'.   \n### 0.2.2 (2017-08-29)\n1. fixed bug that many of the same type of device conflict with each other.   \n### 0.2.1 (2017-08-27)\n1. optimized code.   \n### 0.2.0 (2017-08-26)\n1. add support for Intelligence Pinboard: outlet, temperature sensor, LED switch.   \n2. add support for Qing Pinboard: outlet, temperature sensor.   \n3. add support for Qing Pinboard With USB: outlet, temperature sensor.   \n4. fixed bug that homebridge not works when device is not responding.   \n5. optimized code.   \n6. fixed bug that run homebridge error there is no MiOutletPlatform in config.json file.   \n### 0.1.0 (2017-08-25)\n1. add support for PlugBaseWithUSB: outlet, temperature sensor, USB switch.   \n2. add PlugBase LED switch.    \n### 0.0.1 (2017-08-24)\n1. support for PlugBase: outlet, temperature sensor.   \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyinhangcode%2Fhomebridge-mi-outlet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyinhangcode%2Fhomebridge-mi-outlet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyinhangcode%2Fhomebridge-mi-outlet/lists"}