Be advised: it will be hard to acquire full functionality of gateway using miio protocol. Thanks to miio protocol you can manipulate synchronously gateway (turn light, arm alarm, set color of light, choose radio station) and read some (but not all) sensors. If you want to handle events such as “door opened” or “motion detected” you won’t be able because gateway send this data only to cloud (if you ask for them synchronously by yourself, you can miss (for example) state where door was open (because someone could close them fast)).
If I haven’t discouraged you yet, here are some links I found on the web:
These are pretty good presentation about Xiaomi Ecosystem (it's rather low level): https://recon.cx/2018/brussels/resources/slides/RECON-BRX-2018-Reversing-IoT-Xiaomi-ecosystem.pdf (start at page 14- ) https://dgiese.scripts.mit.edu/talks/Recon-BRX2018/recon_brx_2018-final-split.pdf (start at page 94- ) and also github repo with all the staff author mentions: https://github.com/dgiese Must-have util for testing miio protocol: https://github.com/aholstenson/miio Chinese development documentation for miio? https://github.com/MiEcosystem/miio_open More chinese documentation for miio (might be more useful because includes some field names for miio procotol) https://github.com/louisZL/aiot-open-2b/blob/master/resource_definition.md Here is documentation for lumi protocol (which doesn't work for some of us, udp protocol): https://aqara.gitbooks.io/lumi-gateway-lan-communication-api/content/
Yes, I’m sure that I’m using Mainland China. Probably it’s only option to use xiaomi gateway. You can’t connect “mi home” to xiaomi gateway if you set your location to EU or US. Currently I’m using version _159, I didn’t update post after latest upgrade. Now I’m pretty certain that I’ve got “broken” device and it’s not connected to firmware version.
Yeah, but my “ot” is set to otu, and udp protocol doesn’t work for me.
If both of you could share first two bytes of your xiaomi mac addresses, maybe we could figure pattern and warn others?