No description or website provided.
Switch branches/tags
Nothing to show
Clone or download
Latest commit 7dd673d Feb 25, 2017
Failed to load latest commit information.
doc Documentation Feb 25, 2017
img MiHome documentation Feb 10, 2017
.gitignore Initial commit Feb 10, 2017
LICENSE MiHome documentation Feb 10, 2017 Update README Feb 14, 2017 MiHome documentation Feb 10, 2017 Add list of Xiaomi MAC addresses Feb 14, 2017

Xiaomi's MiHome Binary protocol


Xiaomi is a manufacturer of smart home devices under the "MiHome" label. These devices use an encrypted, proprietary network protocol to communicate with the official smartphone app. It operates on UDP port 54321.

This repository documents the protocol, henceforth referred to as "mihobi", and contains exemplary source code to parse and analyze.

The main goal is to remove the dependence on proprietary software, and to regain control over your own devices.

It has been developed with the Yeelight RGBW smart bulb. Other devices might use yet unimplemented features.

Yeelight bulb




Recovers the protocol from pcap-ng dumps and attempts to decrypt the packet payloads.


  • Python 3.5+
  • tshark, the command-line version of Wireshark
  • PyShark, a Python wrapper for tshark
  • cryptography, a Python library which exposes cryptographic recipes and primitives.


apt-get install tshark
pip3 install pyshark
pip3 install cryptography


./ capture.pcapng.gz

Example output:

### => (xx:xx:xx:xx:xx:xx => yy:yy:yy:yy:yy:yy)
META: Hello

### => (yy:yy:yy:yy:yy:yy => xx:xx:xx:xx:xx:xx)
META: device yy:yy:yy:yy:yy:yy has token: abcdef1234567890abcdef1234567890

### => (xx:xx:xx:xx:xx:xx => yy:yy:yy:yy:yy:yy)
"params":{"ssid":"WiFi name","passwd":"WiFi password","uid":987654321}}

### => (yy:yy:yy:yy:yy:yy => xx:xx:xx:xx:xx:xx)

Core Python library that parses and generates MiHoBi packets.


As of 2017-02-10, the initialization process ("SmartConnect") leaks the user's WiFi credentials, due to weak encryption. See for more details. I do not recommended connecting MiHome devices to your main WiFi network.



Xiaomi is a registered trademark and service mark of Xiaomi Inc., which is not affiliated with the maker of this program and does not endorse, service or warrant the functionality of this product.


The source code and documention in this repository

(c) 2016-2017 Wolfgang Frisch

Licensed under the GPLv3.