mihome-binary-protocol
mihome-binary-protocol is an open-source project that documents and parses Xiaomi's MiHome Binary Protocol (mihobi), the proprietary encrypted UDP protocol used on port 54321 by Xiaomi's smart home devices to talk with their official smartphone app. The repository aims to eliminate dependence on proprietary software and give users control over their own devices. The project includes detailed protocol documentation and two Python tools. pcap-decrypt.py recovers and decrypts mihobi packets from pcap-ng capture files. It requires Python 3.5+, tshark, PyShark, and the cryptography library. Typical usage is ./pcap-decrypt.py capture.pcapng.gz, which prints exchanged messages including metadata like device tokens and JSON-RPC method calls such as miIO.configrouter. The miio.py module is a core Python library for parsing and generating MiHoBi packets. The implementation has been developed and tested primarily with the Yeelight RGBW smart bulb, though other MiHome devices may use features not yet supported. The proje