Xiaomi Aqara Gateway - Log filling with errors

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.

i have over 50 devices split over 2 hubs and i do not see any issues with them being overloaded. Originally i had unavailable entities, but this was resolved by moving my wifi channel furthest away from the zigbee channel. since then they have been rock solid.

Update: I recently hooked up my NUC running Hass.io in Docker via ethernet cable instead of wifi and updated to 0.89.1 (which bumps the PyXiaomiGateway version to 0.12.2) - and finally all my Xiaomi sensors are rock stable again! No more errors in the logs and the sensors work perfectly each time so far.

i’m not able to solve this issue,

My gateway is disabling each 2.5 hours since i change from wireless network to ethernet on a VM.

I also using zigbee2mqtt addon to getting ride of all my zigbee sensors.

When looking at system logs i see following errors each time i sent orders to gateway (in spite it works):

2019-03-19 18:19:51 DEBUG (SyncWorker_1) [xiaomi_gateway] _send_cmd resp << {'cmd': 'write_ack', 'sid': 'xxxxxxxx', 'data': '{"error":"Invalid key"}'} 2019-03-19 18:19:51 DEBUG (SyncWorker_1) [xiaomi_gateway] write_ack << {'cmd': 'write_ack', 'sid': 'xxxxxx', 'data': '{"error":"Invalid key"}'} 2019-03-19 18:19:51 ERROR (SyncWorker_1) [xiaomi_gateway] Got error element in data {"error":"Invalid key"} 2019-03-19 18:19:51 DEBUG (SyncWorker_1) [xiaomi_gateway] _send_cmd >> b'{"cmd" : "get_id_list"}' 2019-03-19 18:19:51 DEBUG (SyncWorker_1) [xiaomi_gateway] _send_cmd resp << {'cmd': 'get_id_list_ack', 'sid': 'xxxxxxxx', 'token': 'Dl6iLFfwvlBMR40Z', 'data': '[]'} 2019-03-19 18:19:51 DEBUG (SyncWorker_1) [xiaomi_gateway] get_id_list << {'cmd': 'get_id_list_ack', 'sid': 'xxxxxxxxx', 'token': 'Dl6iLFfwvlBMR40Z', 'data': '[]'} 2019-03-19 18:19:51 DEBUG (SyncWorker_1) [xiaomi_gateway] _send_cmd >> b'{"cmd": "write", "sid": "xxxxxxxxxx", "data": {"rgb": 1694498815, "key":

i noticed gateway key in HA is correct (from gateway settings in xiaomi app), but its no the same which appears on this logs

Anyone has a clue to solve this issue?