Xiaomi Gateway Offline

Hi, I have a Xiaomi gateway which also connected with Xiaomi light and sensors, and it works well with hassio. But the issue is almost every morning I wake up, I notice that all the Xiaomi related components are offline (unavailable), and once I restart the hassio (Raspberry Pi), it is online again. It’s worth to note that if I restart Xiaomi Gateway instead of restarting hassio, it doesn’t work. So I guess the problem is more related to hassio, not Xiaomi gateway?

Could be your wifi - I am having issues with similar when I was using a wifi repeater…

Hi David, but other devices like broadlink rm works without any problem, strange…

Broadlink is connected on same channel, and remote signal is 433mhz.

I also think is related to WiFi Zigbee issues.

Download a WiFi analizer app, and scan where you live the WiFi s that are on.
If is crowded that might be the issue

I have the same issue, using Docker (not in host network mode, but using the default bridge). The Xiaomi gateway is still reachable from the network (I can access it via the Mi Home application on my phone), but at some point, hass loses it, in a matter of hours.

I don’t know exactly how hassio works, but that might be related: maybe the hass component relies on discovery too much - which doesn’t work on bridged Docker mode.

@maydaymiao Do you still have this issue or have you solved it? I have the exact same issue with the gateway, when i connect it to wifi it wil work for a random amount of time, usually a couple of hours and when it is offline i have to unplug it, re enter wifi details and it is back to how i set it…

This same issue just happened to me last night and I had to reboot my home assistant to get it operational again.

How did you guys plug it in? I just got mine today but it has a strange china type plug

well, that is really simple, you just get a chinese to whatever plug you use adapter or you get an old cord and cut the plug off it and crimp some spade connectors to it and slide them over the right contacts on the gateway. but i recommend the first option

I had this issue frequently, but changing to a better WiFi AP has mostly fixed this issue. I now rarely get this issue. When the xiaomi sensors and switches all become unavailable the only solution is to restart hass.io. Unfortunately restarting the hub doesn’t fix the problem.

I could setup a script to trigger restart of hass.io when all sensors become unavailable, but I am wondering is it possible to just trigger a restart of the xiaomi gateway component only?

Having just the same issue. Will this help?

I’m having same issue just once i changed my rasp to new system HASSOS with Docker.
I have fully operational all sensors on Mihome App , but every 5-8 hours my home assistant can’t connect with gateway and all zigbee sensors.

i’m also wondering if @Argo addon ([Zigbee2mqtt]) would help

Same here, hub is ok and connected but sensors etc go offline all the time!

Not only in HA but also in the mi home app

If offline in app as well most likely a wifi issue. Nothing to do with HA.

Yeah but the hub is always connected to wifi without issues.
Just the sensors going offline… So that shouldn’t be a wifi issue?

Guys there is nothing wrong with the Xiaomi component for HASS I have over 50 sensors with 2 gateways and I never get offline devices. It will be network related, there are a few things that can cause issues.

  1. distance from gateway to wifi network, the wireless card antenna is really poor with very little gain so anything great then 7-10m line of sight the poor old Xiaomi is going to struggle.

  2. Interference from Wi-Fi network, Zigbee frequencies overlap those utilised by 2.4Ghz Wi-Fi as suggested above get an app and perform a network scan to ensure the channels you are using aren’t clashing.

  3. How many sensors do you have connected to your gateway these Gateways have a device limit can’t quire remember what it is but somewhere around the 30 mark.

1 Like

Same here, i have 40 odd devices over 2 gateways and stable. As Jim mentioned, its always an issue with the network that causes the devices to go offline.
There an a number of posts on how to minimise interference between zigbee frequencies and WiFi.

The limit is 30 devices per gateway and remember if you have more than one each gateway is its own zigbee network.

1 Like

by wifi issue I meant from the device to the hub. If it’s not working in the app, it will never work in HA and that is nothing to do with HA.

Okay, so some people struggle with network (those that also fails to read from the app), but in my (and others in the same thread), the app is always able to read the sensors, but hass has lost them.
I’m running hass in venv on my raspbian. Everything works, except at times the sensors are lost. Restarting hass doesn’t help, only restarting the Pi. Again, the Mi app works (even away from my home wifi).
No error message indicate anything wrong with my system, so I’m at a loss here.

Me too, hub is close too wifi ap, but every now and then it drops off HA when mi app still working. The only way to fix it is to restart the pi. I’m in Australia and we are having the occasionally internet issue, but everything else recovers seemlessly. As the OP said even restarting the hub doesn’t fix it. So the issue appears to be HA recovering the connection to the hub. The only way to recover the connection is to restart HA. Any help appreciated.