Xiaomi Aqara Gateway - Log filling with errors

Setup:
Gateway v2, 1 Door sensor, 1 motion sensor, 2 Yeelights.
HassOS-HassIO on Pi3B+ v0.75.3

All was working well, untill the log started filling up with these errors related to the gateway;

2018-08-10 08:54:01 WARNING (MainThread) [homeassistant.setup] Setup of config is taking over 10 seconds.
2018-08-10 08:55:46 WARNING (SyncWorker_13) [netdisco.ssdp] Found malformed XML at http://192.168.2.40:9080: status=ok
2018-08-10 09:03:52 ERROR (MainThread) [homeassistant.core] Error doing job: Task was destroyed but it is pending!
2018-08-10 09:14:12 ERROR (SyncWorker_2) [xiaomi_gateway] Non matching response. Expecting write_ack, but got read_ack
2018-08-10 09:14:12 ERROR (SyncWorker_9) [xiaomi_gateway] Non matching response. Expecting read_ack, but got write_ack
2018-08-10 09:14:12 ERROR (SyncWorker_2) [xiaomi_gateway] No data in response from hub None
2018-08-10 09:14:12 ERROR (SyncWorker_9) [xiaomi_gateway] No data in response from hub None
2018-08-10 09:14:44 ERROR (SyncWorker_11) [homeassistant.components.light.yeelight] Unable to update bulb status: A socket error occurred when sending the command.
2018-08-10 09:20:03 WARNING (MainThread) [homeassistant.helpers.entity] Update of binary_sensor.door_window_sensor_158d00023700c1 is taking over 10 seconds
2018-08-10 09:20:03 ERROR (SyncWorker_12) [xiaomi_gateway] Cannot connect to Gateway
2018-08-10 09:20:03 ERROR (SyncWorker_12) [xiaomi_gateway] No data in response from hub None
2018-08-10 09:34:21 ERROR (MainThread) [homeassistant.core] Error doing job: Task was destroyed but it is pending!
2018-08-10 10:01:54 WARNING (MainThread) [homeassistant.helpers.entity] Update of binary_sensor.door_window_sensor_158d00023700c1 is taking over 10 seconds
2018-08-10 10:01:54 ERROR (SyncWorker_6) [xiaomi_gateway] Cannot connect to Gateway
2018-08-10 10:01:54 ERROR (SyncWorker_6) [xiaomi_gateway] No data in response from hub None
2018-08-10 10:06:01 WARNING (MainThread) [homeassistant.helpers.entity] Update of binary_sensor.door_window_sensor_158d00023700c1 is taking over 10 seconds
2018-08-10 10:06:01 ERROR (SyncWorker_4) [xiaomi_gateway] Cannot connect to Gateway
2018-08-10 10:06:01 ERROR (SyncWorker_4) [xiaomi_gateway] No data in response from hub None

Strange thing is that all sensors and switches still work.
I can control the gateway light and so forth.

My gateway setup:

xiaomi_aqara:
  discovery_retry: 10
  gateways:
    - host: !secret gateway_ip
      key: !secret gateway_key

Got a fairly clean setup, with some automations, but not too many connected devices.
Been searching for a solution / some background:

Would be great if someone got an idea.

Are your yeelights also not working?

PS I see you are cross-posting, please stick to one topic instead of asking for help on the same issue in multiple topics.

I can control the Yeelights / they work. It just gives these errors.

I know, donā€™t want to flood the forum with same topics.
But the topic i found, was a bit different. I will the delete the reference.

Ok, it could be the key as the gateway light also works with it but youā€™ll not get sensor info. Did you already try to get a new key?

Aah, thanks for the suggestion.
Will try that.

Initially, had some issues with generating the key on ios.
That didnā€™t work.
Used the emulator Bluestack to get the key.
Going to repeat the process for a new key.

Btw, can i do this at a distance?
As iā€™m at work :grin:

I guess you can if you have a VPN connection. By the way Iā€™m not sure if this is the issue.

Never hurts to exclude a few options.
That being said, the error log doesnā€™t show any errors, regarding a faulty key / couldnā€™t retrieve key.

Btw, I recently migrated to Lovelace.
Can of course load both UI frontpages.
But could this have something to do with the errors?

I have ā€˜deletedā€™ the ā€˜ui-lovelace.yamlā€™ restarted HA, to see if the errors still occur.
Update: still getting the errors; seems that it doesnā€™t involve the lovelace migration.

its a known issue with getting the key on with IOS, its hit and miss its correct

But could the key be the cause of (all) these gateway errorsā€¦

Edit: generated a new key through Bluestacks.
Itā€™s not often but still getting the ā€˜bulbā€™ errors.
I now have simplified the Yeelight configuration:

light:
  - platform: yeelight
    devices:
      192.168.2.61:
        name: Booglamp
#        transition: 500
#        use_music_mode: True
#        save_on_change: True

Did some more testing :grin:

Itā€™s a stubborn error;
Unable to update bulb status: A socket error occurred when sending the command.

Removed the yeelights, resetted them, gave them new static ipā€™s.
Variated with the config of the gateway.
With or without mac/host, caps/lower case.

Config actual;
Gateway;

xiaomi_aqara:
  discovery_retry: 5
  gateways:
    - key: !secret gateway_key
      host: !secret gateway_ip

Yeelights;

homeassistant:

################################################################################
## YEELIGHT
################################################################################

light:

 - platform: yeelight
   devices:

    ################################################################################
    ## BOOGLAMP
    ################################################################################

      192.168.2.101:
        name: Booglamp
        use_music_mode: True
        save_on_change: True

Will watch it closely, but so far havenā€™t got any;
[homeassistant.components.light.yeelight] Unable to update bulb status: A socket error occurred when sending the command.
[xiaomi_gateway] No data in response from hub None
errors.

Iā€™m having similar issues with GW and the Yeelight bulb - really annoying ( did you manage to fix it?

Hello Kostya, a tad delayed answer, but sadly i havenā€™t managed to solve it yet.

Hey, Iā€™ve changed afew things and havenā€™t seen any errors from the gateway since then (about a week).

  • I moved the hub to another location in another room a bit further away from wifi router
  • I changed wifi channel (in my case I chose channel #1)

Iā€™m not entirely sure which step solved it but now it seems fine! Next step - do something with errors from Xiaomi humidifier :slight_smile:

1 Like

Thanks for the tips. Gonna try it out also.

Did you solved conection problem with Xiaomi Gateway?
Iā€™ve the same problemā€¦

Having similar issues, however I consider this to be an issue with the gateways rather than HA.
My gateways keeps losing connection and rebooting. This can happens few times a minute, but also can be ok for hoursā€¦
Clueless to what this could be

Hi all, yes I have the same problem periodically I found in the logs ā€œCannot connect to Gatewayā€ and ā€œNo data in response from hub Noneā€. The sensors work but are not completely reliable, sometime some events are not captured by HA (e.g. door opened), while are correctly managed by Mi Home app.

Same issue for me over here. I have a total of 16 Xioami sensors and switches connected to the hub, which are quite unrealiable in Home Assistant - while they work perfectly fine in the MiHome app. I get the same ā€œCannot connect to Gatewayā€ and ā€œNo data in response from hub Noneā€ errors in the log from time to time, sometimes every few hours. Havenā€™t found a solution to this problem for now, already tried changing the wifi channel and moving the gateway to another room. Hope someone has a fix for this, otherways I have to go the Zigbee2Mqtt route and ditch the gateway.

I also have this exact same problem.

Iā€™m thinking that can be related with the HUB overloadedā€¦ Iā€™m on 30 devices.