Pretty shocked that Xiaomi publishes the protocol: https://iot.mi.com/new/doc/accesses/direct-access/embedded-d...