Xiaomi Gateway Errors , but seems to be working fine

Hi over the past week I constantly get the follow errors in the log reference the Xiaomi Gateway

Cannot connect to Gateway
06:47 components/light/xiaomi_aqara.py (ERROR)

No data in response from hub None
06:45 components/light/xiaomi_aqara.py (ERROR)

Non matching response. Expecting write_ack, but got read_ack
06:45 components/light/xiaomi_aqara.py (ERROR)

However it seems that the gateway is working and the sensors connecting are reporting ok, but its filling the log constantly.

I have 3 Gateways and I am not sure what one or all of them are producing the error… Any ideas ?


any ideas ? the Errors are still appearing …


I have these errors too. All of them.

The first error is due to timeouts when requesting data read from hub. I see a lot of them, when my wifi router is overloaded by e.g. torrent download.

I’m going to debug 2nd and 3rd this week.

hi thanks for the reply.

Oddly it seems to happen at quiet times and then just carries on…

I look forward to seeing what the other 2 are about.

I found the reason. It’s not a bug of aqara hub, it’s a race condition bug in PyXiaomiGateway library, because it’s working with UDP protocol (which guarantees almost nothing) as with TCP. I will fix it when I will have a free time.

Created a bug report https://github.com/Danielhiversen/PyXiaomiGateway/issues/45. I hope Daniel will have time to fix it.

Great thanks :slight_smile:

Hello @SteelRat and @Hefford27! How are you today?

Sorry to bother: would you mind taking a look at my post here about a similar problem I am facing with the Aqara component as well? Problem with multiple Xiaomi Aqara Gateways

I am about to go crazy about this hehe

Thanks a lot!

Hi all,

Is this already close to a solution. Since not to long I have this errors as well. Everything appears ok (sensors are reporting), however new sensors are not added/discovered. I’m running latests stable HA.



After some day I get error:

2018-12-30 21:05:49 ERROR (SyncWorker_7) [xiaomi_gateway] Cannot connect to Gateway
2018-12-30 21:05:49 ERROR (SyncWorker_7) [xiaomi_gateway] No data in response from hub None

I am using HA 0.84.1 and Xiaomi Gateway.

I see similar issue was fixed in underlying library:


…but it was updated in HA?