Xiaomi Gateway Integration

Yes…A very BIG Thanks to @Danielhiversen for making this an official component finally :joy::clap:
I also wanted to say we should also thank @rave for starting this. I do hope he will some day come back and continue to contribute to this component. And not forgetting others like @syssi, @jcastro & @DanielGalle.

5 Likes

Is there a way to get “faster” information from the motion sensors. Not sure if this is a HA thing but once triggered they stay active for the next 60 seconds, while in the Xiaomi app I can see the sensor being retriggered within this period of time I think.

And yes a big Thank you! to the people involved for all the work on this great component. It’s highly appreciated!

Just wondering, the switch you linked to has two paddle keys but connects one circuit? What do the individual keys do in default coupled mode? Thanks

If the wall switch has two buttons it has two circuits also. A single button is equipped with a single relay.

1 Like

I have upgraded to 0.50 and removed the custom component. But my gateway is not discovered anymore:

2017-07-30 15:34:15 ERROR (SyncWorker_12) [homeassistant.components.xiaomi] No gateway discovered
2017-07-30 18:52:20 ERROR (SyncWorker_16) [homeassistant.components.xiaomi] No gateway discovered
2017-07-30 19:07:51 ERROR (SyncWorker_0) [homeassistant.components.xiaomi] No gateway discovered
2017-07-30 19:10:08 DEBUG (SyncWorker_4) [homeassistant.components.xiaomi] Expecting 1 gateways
2017-07-30 19:10:08 INFO (SyncWorker_4) [homeassistant.components.xiaomi] Discovering Xiaomi Gateways (Try 1)
2017-07-30 19:10:13 INFO (SyncWorker_4) [homeassistant.components.xiaomi] Discovering Xiaomi Gateways (Try 2)
2017-07-30 19:10:18 INFO (SyncWorker_4) [homeassistant.components.xiaomi] Discovering Xiaomi Gateways (Try 3)
2017-07-30 19:11:39 ERROR (SyncWorker_17) [homeassistant.components.xiaomi] No gateway discovered

This is my config:

# configuration
xiaomi:
 gateways:
   - mac: !secret xiaomi_mac
     key: !secret xiaomi_key
# secrets (changed the last parts to aaaa)
xiaomi_mac: f1b4aaaaaaaa
xiaomi_key: xa42aaaaaaaaaaaa

It used to work with the custom component, I renamend all sid settings to mac.

The gateway does not publish (broadcast) the information very often. If you need a more accurate information the motion sensor must be polled. The official component does not support this feature at the moment.

It looks the the required implementation (PyXiaomiGateway) is missing. Please install the dependency manually:

pip install 'https://github.com/Danielhiversen/PyXiaomiGateway/archive/aa9325fe6fdd62a8ef8c9ca1dce31d3292f484bb.zip#PyXiaomiGateway==0.2.0'

May be inside of your virtualenv. If the library is already installed power cycle your gateway and restart home assistant.

it looks like the gateway lost the connection to the wifi network. Do you know how I can change the wifi network which is used by the gateway? I think about using hostapd on the rpi3 for an iot wifi which blocks internet and so on…

Is there a difference between the gateway and gateway 2?

The original gateway is only good with the MiHome app. If you are looking into integrating with other home automation applications like HA, then you need the gateway 2 which has a developer mode to share the information.

Is there particularly a way to tell the difference?

Gateway2 has radio. The first one does not.

Sorry, I was more meaning is there any physical difference? As in a way to tell them apart from the pictures?

I’ve never seen a gateway v1. I don’t know how you might find them.
Do you happen to hve a gateway and want to learn if it is v1 or v2. -> Just open the app and look for the radio.
Or Do you want buy a new one and be sure that it is v2. Just ask the seller. They don’t sell v1’s anymore.

Nice one, Daniel and the other contributors. Big thanks for this.

I bought my first in November 2016, i think, and was v2. I doubt you find v1, to be sure ask the seller

Just to let you know that I changed to custom component to the official one without any issue.

Thank you all!

Eeek, I had already bought one…Just waiting on it coming (not chuffed as I bought it from ebay - could’ve got one at ~£20 but went for one at ~£30 because it said it was in the UK - turns out it’s coming from China the same as the rest of them - not fussed but I wanted it quick so have basically wasted ~£10, could’ve got a couple of buttons for that :confused: )

Suppose I’ll just have to wait - I imagine it’ll end up being the v2 if the v1 is so old

Can anybody confirm thecompatability of xiaomi cutain motor with dooya DT82? As the latter is twice as cheaper

Thanks Tommy for the explanation.
It’s now easier with the 0.50 version xiaomi supported.