{"id":13678104,"url":"https://github.com/OpenMiHome/mihome-binary-protocol","last_synced_at":"2025-04-29T12:33:25.138Z","repository":{"id":39749119,"uuid":"81571948","full_name":"OpenMiHome/mihome-binary-protocol","owner":"OpenMiHome","description":null,"archived":false,"fork":false,"pushed_at":"2022-02-19T07:25:06.000Z","size":38,"stargazers_count":709,"open_issues_count":11,"forks_count":89,"subscribers_count":63,"default_branch":"master","last_synced_at":"2024-08-02T13:20:48.523Z","etag":null,"topics":["encryption","mihome","protocol","xiaomi"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenMiHome.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-10T14:17:20.000Z","updated_at":"2024-07-27T20:44:42.000Z","dependencies_parsed_at":"2022-07-31T23:38:02.271Z","dependency_job_id":null,"html_url":"https://github.com/OpenMiHome/mihome-binary-protocol","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/OpenMiHome%2Fmihome-binary-protocol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenMiHome%2Fmihome-binary-protocol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenMiHome%2Fmihome-binary-protocol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenMiHome%2Fmihome-binary-protocol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenMiHome","download_url":"https://codeload.github.com/OpenMiHome/mihome-binary-protocol/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224173535,"owners_count":17268126,"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":["encryption","mihome","protocol","xiaomi"],"created_at":"2024-08-02T13:00:50.162Z","updated_at":"2024-11-11T20:30:59.894Z","avatar_url":"https://github.com/OpenMiHome.png","language":"Python","readme":"# Xiaomi's MiHome Binary protocol\n\n## Summary \nXiaomi is a manufacturer of smart home devices under the \"MiHome\" label. These \ndevices use an encrypted, proprietary network protocol to communicate with \nthe official smartphone app. It operates on UDP port 54321.\n\nThis repository documents the protocol, henceforth referred to as \"mihobi\", \nand contains exemplary source code to parse and analyze.\n\nThe main goal is to remove the dependence on proprietary software, and to regain \ncontrol over your own devices.\n\nIt has been developed with the _Yeelight RGBW smart bulb_. Other devices might \nuse yet unimplemented features.\n\n![Yeelight bulb](img/yeelight-exploded.jpg)\n\n## Documents\n\n[doc/PROTOCOL.md](doc/PROTOCOL.md)\n\n## Tools\n\n### pcap-decrypt.py\n\nRecovers the protocol from pcap-ng dumps and attempts to decrypt the packet payloads.\n\nDependencies:\n\n * Python 3.5+ \n * [tshark](http://wireshark.org/), the command-line version of Wireshark\n * [PyShark](https://kiminewt.github.io/pyshark/), a Python wrapper for tshark\n * [cryptography](https://cryptography.io/), a Python library which exposes cryptographic recipes and primitives.\n\nInstallation:\n\n    apt-get install tshark\n    pip3 install pyshark\n    pip3 install cryptography\n\n       \nUsage:\n\n    ./pcap-decrypt.py capture.pcapng.gz\n    \nExample output:\n\n    ### 192.168.13.2 =\u003e 192.168.13.1 (xx:xx:xx:xx:xx:xx =\u003e yy:yy:yy:yy:yy:yy)\n    META: Hello\n\n    ### 192.168.13.1 =\u003e 192.168.13.2 (yy:yy:yy:yy:yy:yy =\u003e xx:xx:xx:xx:xx:xx)\n    META: device yy:yy:yy:yy:yy:yy has token: abcdef1234567890abcdef1234567890\n\n    ### 192.168.13.2 =\u003e 192.168.13.1 (xx:xx:xx:xx:xx:xx =\u003e yy:yy:yy:yy:yy:yy)\n    {\"id\":1234567890,\"method\":\"miIO.config_router\",\n    \"params\":{\"ssid\":\"WiFi name\",\"passwd\":\"WiFi password\",\"uid\":987654321}}\n\n    ### 192.168.13.1 =\u003e 192.168.13.2 (yy:yy:yy:yy:yy:yy =\u003e xx:xx:xx:xx:xx:xx)\n    {\"result\":[\"ok\"],\"id\":1234567890}\n\n\n### miio.py\n\nCore Python library that parses and generates MiHoBi packets.\n\n## Notes\nAs of 2017-02-10, the initialization process (\"SmartConnect\") leaks the user's \nWiFi credentials, due to weak encryption. See `PROTOCOL.md` for more details. \nI do not recommended connecting MiHome devices to your main WiFi network.\n\n## Appendix\n### Legal\n\nXiaomi is a registered trademark and service mark of Xiaomi Inc., which is not \naffiliated with the maker of this program and does not endorse, service or \nwarrant the functionality of this product.\n\n### Author\n\nThe source code and documention in this repository\n\n(c) 2016-2017 Wolfgang Frisch\n\nLicensed under the GPLv3.\n\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenMiHome%2Fmihome-binary-protocol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOpenMiHome%2Fmihome-binary-protocol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenMiHome%2Fmihome-binary-protocol/lists"}