I am running Home Assistant on a Raspberry Pi on Docker. I have configured the Xiaomi gateway and a couple of two button wall switches. I have an automation rule to turn some lights on when the switches are pressed.
I’m getting inconsistent response times for the switches. Sometimes, the light turns on instantly, but sometimes there is a 5 to 10 seconds delay for the light to turn on.
It’s not a problem with the switch because the Xiaomi app gets switch press instantly. Similarly, the lights always turn on instantly when turned on by another method. So that narrows it down to a delay to trigger the automation.
Any idea what is the problem and how to resolve it?
I have the same problem with Xiaomi wireless wall switch and the round wireless switch. If I set it up to turn on lights within the Xiaomi app, it’s immediately. When done via HA, it is slow.
But as the OP said it works fine using the Mi Home app works fine so that should rule out any issues on the Zigbee network.
The issue for me appears to be any automation involving Xiaomi switch. This includes body sensor, window/door sensor, remote switch (square and round) and wall switches with and without neutral. Some controlling Sonoff’s some controlling other Xiaomi devices.
Running hassio (latest version) on Pi3 hard wired directly to my router, which is google WiFi network and all tests show the Xiaomi gateway is connected fine.
Ive spent time fine tuning like getting the database down to 100Mb, switching over to google WiFi from my ISP supplied router etc and just can’t seem to get to the bottom of the issue.
I have just tested the automation between the wireless switch and a light switch in HA and via the Mi Home app. Exactly the same issue - randomly between 1 and 10 secs to activate. I have an old Mi gateway they are running through, so I will test next, I think with the multi-bluetooth/zigbee gateway and see if that makes a difference to either.
I’ve worked out that there seems to be an occasional delay when subsequent events are fired.
It seems sometimes the gateway hangs on to the inbound request and subsequent requests are simply not serviced until that timeout completes. I can see it in the trace logs.
I’m not sure if this is an integration issue, or a gateway issue - I assume integration. Will try pick the code apart later