Xiaomi Gateway (lumi.gateway.v3) intermittent connection lost - Need help

Hi, I’m having the similar problem with the Xiaomi Gateway (V3) where it intermittently lost connection with HA with following errors. The strange thing is, whenever it lost connection, it can seems to recover itself ONLY IF the HA didn’t send any message to it, such as telling it to switch on my wall switch.

2020-02-13 02:31:16 ERROR (SyncWorker_19) [xiaomi_gateway] Cannot connect to Gateway
2020-02-13 02:31:16 ERROR (SyncWorker_19) [xiaomi_gateway] No data in response from hub None

Whenever it failed to recover, the Mi Home app also can’t connect to it but those motion sensor are able to send the stats to HA correctly. It just that it can’t trigger my wall switch/plug and the only thing i can do is doing a hard reset of the gateway or by restarting the router. There is no trend of the connection lost and it happening randomly.

So far, i have tried the following but NONE OF THOSE HELP,

  1. Change the wifi channel to 1 and 6. My gateway is using channel 25.
  2. Physically re-allocate the gateway far away or close to router.
  3. Disabling SPI firewall in my router.
  4. Regenerate the key.
  5. Set static IP for the gateway in my router.

Also, upon connection lost, i have scanned the gateway connection with nmap and both 9898 and 4321 are opened. My router did support multicast.

Here is my gateway information:
Model: lumi.gateway.v3

Also, I have another Xiaomi universal IR remote (V2) connected to my HA and it’s also having connection issue randomly. And it seems that whenever the gateway is down, this IR remote seems also down at the same times. I wasn’t sure are these 2 issues are related.

Anyone have any advise how to fix the problem?

For what it is worth, I used to have numerous connectivity issues and errors with my xiaomi gateway, the registering of various sensors on the gateway to etiher china or elsewhere depending on where I got my Xiomi sensors from… it was very unstable…

Since I moved to deconz I have had no issues… I would seriosly consider keeping your data in your home and remove any reliance on cloud based 3rd party products and services…

I’m thinking to move to CC2531 as well but recently it is bit difficult to buy from China. So have to stick with the Mi gateway for now.

look at conbee as well… it costs more, but more user friendly…

This morning, the gateway lost connection again and can’t turn off/on my wall switch. I login to my router and change the wifi channel from 6 to 1 and click save without restarting the router or the gateway. The gateway is able to re-connect itself and i can control the switches.

I’m suspecting the lost connection is nothing related to the hardware but more likely network issue., maybe the device drop itself off from the network after some time. Maybe changing the wifi channel force the gateway reset its wifi connection and re-connect to the network.

Any idea what else I should check or any network tool that will help me diagnose the problem?

do you use the same ssid for 5 & 2.4G?
What router do you have?

Check also your password, I have noticed that with some equipment from china that sometimes various equipment does not liek special characters, but I dont think this will be your issue as when this happens the device will not connect at all.

Seriously, make the move to deconz, you will spend hours trying to sort this out only to find that when you do fix it, something will change on the cloud side and then you are back at square one troubleshooting again…

Yes… I’m using the same password for 2.4GHz and 5GHz. But i have disabled the 5GHz network in my router. I’m using TP link AC1200 router.


The only way i can get this is through Amazon.

There are loads of alternatives… point being that you should ditch your 3rd party, cloud based, walled gardens otherwise you will be forever putting out fires

I have Xiaomi Gateway since begining of my smart home so about 3 years.
Now I am at the limit of gateway max devices. So I started to migrate some of them to CC2531.
I cn see errors you mentioned in my log but this doesn’t affect Home Assistant.
I even blocked traffic from gateway to outside world.
I also was wondering about Conbee but took CC2531 route as it is much cheaper.
When you use Zigbee2mqttAssistant add-on it gets better regarding user experience. I can also generate dynamic map of Zigbee connections which is cool :slight_smile:

So I agree on disabling cloud and using Conbee or cc2531.
Additionally - I have xiaomi cube (acting as remote). On cc2531 I can make automation based on which side the cube is put on … you can not see that in Mi Home app.

:slight_smile: :+1:

For blocking the gateway internet access, are you using mac filtering features in router? Also, can the cc2531 and gateway co-exist?

Yes, I’m using Mac filtering in my router.
I have Gateway working on channel 20 and cc2531 on channel 25.
It’s similar to WiFi so can coexist as well.
I didn’t experience any issues

AFAIK, the sensors can only be bound to 1 gateway… that is not to say that you could have some sensors connected to the gateway nad others to the cc2531… but why would you want to complicate your setup? You also want to maximise the mesh so get them all talking to the same central point whatever that is…

I have quite a lot of devices connected to my gateway currently so migrating to cc2531 might takes sometimes. There might be instance that some devices are still connecting to gateway and cc2531 during migration and i want to ensure all my automation are still working during the migration.

it is a pain… and deconz is not flawless, but if you have sya hue biulbs and xiaomi sensors, then at least you are aggregating and combining in one mesch which also means less interference in the frequency channels…

Just want to update my latest observation on the gateway connection issue.

Observation -1 : I have set my router to use auto channel assignation for the wifi and it seems the connection drops occurrence is lesser now and fairly stable over a week. Although i’m still seeing the connection issue in the HA logs once a while but the gateway is still working fine.

Observation -2 : I did notice whenever I switched on my working laptop which is connected to my network with wifi, the gateway seems to have more connection issues and eventually the gateway will stop working until i hard reset it. Maybe my laptop wifi is interfering with the gateway connection? Also, whenever the gateway is down, i tried to check the 4321 and 9898 ports with nmap, both of them are still opened.

I’m still waiting the CC2531 to be shipped over to me…

I have the same problem. Do you have a solution?

No. I have give up the gateway and switched to CC2531.

1 Like

I have the same problem with my xiaomi gateway V3. I used this gateway about 2 years without problem Now from about 2 months in HA receive message time-to-time can’t connect to gateway and sometimes after HA restart xiaomi aquara can’t discovered. If I unplug it and plug in again it is working a while but the problem is come back always. Check with the nmap and the ports are open. But I read somewhere this mac addres what have my gateway have problem colsed ports. But then don’t know why worked 2 years without problem?!
I have Zigbee2Mqtt and all of my sensor is there, but I like the gateway use for doorbell and night light etc. So need a solution how to solve this problem?