Xiaomi Gateway Integration

Go in mi home app
Click on the gateway
Click on top right 3 dot
Click on about
Click on second menu from bottom (is Chinese)
Click on the regenerate icon
The new key is shown, copy it (write it down)
Click OK in Chinese

In the app?? I looked around and i cannot see where it can be. I even re-pared all my sensor and the plugs with the gateway but without any success. Is bizarre although it says invalid in the log but it has the right key.

Sorry is this the key for the hub or for the switch? My motion sensor works and the door switch only thing that does not work is the switch and the gateway to be controlled from HA.
If i understand right i have to copy the first 16 characters of the token, is that correct?
UPDATE i tried multiple time but my token remain the same what i am doing wrong??

which switch are you talking about? I do not understand.

I have a “switch” from xiaomi that shows as subdevice of the gateway (like door sensor, cube, plug, PIR sensor). It does not have any “key”, because is all controlled by the gateway, so the key is for the gateway

Sorry man i made a big mistake. Thanks for your explanation that really helped.
For all this time i been using the token key (first 16 characters) that is found on the last button (Chinese)in about. Since my motion sensor and the door switch worked i thought that is the key, i looked on some of the Chinese instructions and i thought that is the key.
Thanks all for your help.
Thanks Claudio and Danielhiversen

nowadays we should all learn chinese :smile:

4 Likes

For those who can’t get the gateway sid, you can put an empty sid value in the config and when HA starts, you can get the sid from the devices page. There should be something like light.xxxxxxxx where the x value is the gateway sid.

This is the step by step on how to get the gateway key. Just google translate it if the images is not clear enough. Also, there’s a bug on IOS, at least on my iphone .you’ll need Android to get the key

https://github.com/louisZL/lumi-gateway-local-api/blob/master/device_discover.md

1 Like

isn’t it the mac address in lower case without the : ???

I put that and is working

Sid is the mac address. It’s just that people is having trouble finding the mac. It’s just easier to get it from the device page because the gateway light id is the sid / mac

1 Like

Hi Rave thanks for all your hard work in making this work, I sent few beers (via paypal, Grocott), enjoy.

I don’t know if is possible, but will be grate if the gateway can be used as a alarm siren. I know there is scene that does that in the hub. Just wonder if that can be integrated in the HA somehow, or if you thought of this already. And been able to add own radio stations or use it as a speaker will be helpful.
Just wondering if this is possible or if you thought of adding this functions.
Thanks again.

1 Like

I have to say that even with the Xiaomi app being a mix of English and Chinese and a bit convoluted, it is very nice to have a simple scene builder for sensors & devices, using simple button clicks to create triggers / actions without any coding.
Perfectly suited for people like Me looking for a quick and easy option!

Be great if HA could work towards something similar to help build the configuration.yaml

1 Like

Will have to wait until the API is available through new gateway firmware. Right now, only the gateway light API is exposed.

1 Like

agreed. HA is still not ready for mainstream users. I hope ease of use will be the direction for HA.

I’m also spending some time building my own IOT framework based on NodeJS / React which allows you to do everything from the browser or app. Dynamic adding of devices and automation is also my goal. Still a long way to go though

4 Likes

was thinking the same

These guy host radio station or you can host your own . It seem that you have to change dns address
http://ximiraga.ru/?chlang=en

1 Like

Xiaomi mi radio server

1 Like

Hi,

Is it just me having this issue?
https://github.com/lazcad/homeassistant/issues/21

Thanks

I’ve made a dirty fix for it, at least it works but the icons colours do not reflect the actual status. If someone with proper experience can help it would be awesome.
Thanks

I’m having the same issue with the zigbee plug since yesterday…