Xiaomi gateway not discovered

My Xiaomi gateway worked well, but since some days I can’t get it to connect anymore. In the logs from home assistant I see:

2017-08-20 16:51:19 ERROR (SyncWorker_0) [homeassistant.components.xiaomi] No gateway discovered
2017-08-20 16:51:20 ERROR (MainThread) [homeassistant.setup] Setup failed for xiaomi: Component failed to initialize.

I can however perfectly reach it through the MiHome app.
The local api mode is on and everything is triple checked…
I pushed the button on the gateway for 10 seconds and reconnected it with the gateway, turned local api on again and updated the token, no luck.

Is there a way to hard code the IP or test/debug anything?

1 Like

@Bram_Kragten :
That means that the HA is not getting any response from your Xiaomi gateway. Might be a local network problem or your firewall.

  • Turn off the firewall on the HA computer
  • Try to leave the mac address blank.
  • Try to set discovery_retry: 10

MiHome app gets the data from a Chinese server, but HA uses the local network.


It is available. Or what do you mean?

@Danielhiversen Thanks, but it still is not working. Is it possible to skip the discovery and put in an hardcoded IP where it will connect to?


No, there is no support for that

You can try to disable and then enable the LAN access again

No luck unfortunately… Will try some more things tonight.

I’m having the same problem setting up my gateway for the first time. I’ve got all of my IoT devices on my Guest wifi network and wondering if that’s blocking my HA computer from finding the Gateway or vv. Will test it when I get a chance tomorrow. Am I correct in thinking that the key: field requires what the app refers to as password? Does this field need quote marks like the IP address if we use interface:?

The error message I’m getting is:
2017-08-23 00:19:29 ERROR (MainThread) [homeassistant.loader] Unable to find component xiaomi
2017-08-23 00:19:29 ERROR (MainThread) [homeassistant.setup] Setup failed for xiaomi: Component not found.

I had a lot of hassle getting it to work turn out to be a problem with mulicasting and my router. I was using another wifi router as a bridge for a while but found out that if I disabled IGMP snooping it works with no problems on my original router.

Which version of HA are you running? You need 0.51 or 0.52

1 Like

OK, it is fixed… what helped was a reboot of my router… :weary:

I tried that also, and the xiaomi gateay was working again in Hassio. Asus RT-3200 router…

Thanks Daniel, I had forgotten this most basic of steps, I hadn’t realised just how fast HA is progressing.

enable the LAN access again and again and angain
but Can not communicate with udp
i’am edited PyXiaomiGateway to test
There are no cases of the same feedback?

I am having the same issues here. It has to work with my router (somebody says it is possible that the wifi-router isn`t compatible), because a buddy has the same router and it works.

The firmware?
It’s also new firnware?
It’s also reset?

Its the latest version of HA (0.52) and of the Xiaomi-Gateway (1.41_149.0143). And installed the factory new xiaomi.stuff yesterday for the first time.

Still no luck? I would like to provide some support.

I do not know for your concern… sorry.
I’ve encounter some errors too and I think one can update the xiaomi gateway guide :

  • In new android app, to enable the advanced menu (to switch on LAN for your gateway) you need to click several time on the version number in the about section (not in the white area as in the community post)

  • To have your access token, it’s not necessary to use adb or something else. The token is in the infos of the advanced options.

Oh no! The first(?) person who stumbled upon the token & key information on the same page. The key is needed for the xiaomig gateway (zigbee). The token is just needed for xiaomi wifi devices without an open api (vacuum.xiaomi, xiaomi_philipslight and xiaomi_plug).

I’m answering to your post from the other thread here since I have the same discovery problem.

So I did test multicast traffic with this app on my phone : https://play.google.com/store/apps/details?id=net.liveforcode.multicasttester&hl=fr

The phone is on the same Wifi than the gateway.

When I listen to while restarting home-assistant, I can see the “whois” message from my NAS. And when I send a message from the app, I can see it whith a tcpdump on the NAS. With a tcpdump, the only multicast data I’ve seen from the gateway are the mDNS ones.

Like @PatteWi, my gateway is brand new and I don’t have any subdevice on it yet. Maybe that’s the reason it’s not sending anything ?

1 Like