Xiaomi gateway light unavailable after exactly 2,5 hours (Solved)

It is weird that I need to enable multicast_snooping under my merlin router setting then I can see package to reach the host of the container. However, the multicast package does not pass to the container and the value of /sys/devices/virtual/net/docker0/bridge/multicast_snooping is always 1. I changed it to 0 and reboot and it turns back to 1. So I cannot test if it really work if disabling snooping under the host really works. I am using debain + docker + hass.io setting, are there any means to correct the multicast_snooping setting under the host? thank you.

Hi! I have the same problem on hassio installed on raspberry pi3b+ā€¦ could you explain me where can I find this file?
Thanks a lot!

Another fix has been posted by @sonartribe at https://github.com/home-assistant/home-assistant/issues/20329#issuecomment-466821849

Very likely that itā€™s going to be in a new HA version coming the next weeks.

If the MAC address of your Xiaomi Gateway starts with ā€˜04ā€™ please update HA to 0.88.2 because of: https://github.com/home-assistant/home-assistant/pull/21453
Some people here are affected. Some may be not.

Iā€™ve solved my problem by opening port in firewall

Which port are we talking about here? Thanks
Right now I am using latest firmware 1.4.1_167_0158, HA on Dockers 0.91.4, gateway light still same issue.

9898

My solution was this:
In configuration.yaml:
change:

xiaomi_aqara:
  discovery_retry: 5
  gateways:
    - key: xxxxxxxxxxxxxxxx

to:

xiaomi_aqara:
  discovery_retry: 99999
  gateways:
    - key: xxxxxxxxxxxxxxxx

Had no disconnects now for more than 24 hours.

I donā€™t get why open port is a solution.
Home assistant and xiaomi gateway are in the same lan, so firewall is ineffective.

Hi, after days of investigation, I found a solution. But it depend by my installation.
Iā€™m using Hass.io with a virtual machine on vmware and before I had a nat lan in the configuration of the virtual machine. I opened the port in the nat settings of vmware, but probably thereā€™s some limitation. When I changed to bridged lan, xiaomi gateway started to work, since all the traffic passed through my real router.
Hope it helps.

hi,
i still have this problem.
any update about it ?

Hi, I have been working on trying to get my Xiaomi sensor to stop showing unavailable. I had to abandon the Xiaomi bridge as it just stopped working after a firmware update. Before the update, the bridge was in the middle of the house, and I had no problem to view the sensor in the app or Hassio. I bought the Nortek Zigbee HUSBZB-1 device and loaded the sensor, they stopped working after a while, always said ā€œunavailable.ā€ I thought I had issues with the network and bought some Ge Zigbee switches, as I thought they would function as a repeater. The Ge switches did not work, and I gave up for a while. I changed out batteries, and that seems to work for about an hour, then again the ā€œunavailable.ā€

Then, I had to move my Hassio setup to an area that was less than 15 feet from my Nortek Zigbee HUSBZB-1 sensor to a temp sensor. I replaced the batteries on the temp and water sensor, and for a week, I have not lost connections. So I concluded, I need better repeaters, but which ones. I found a write up from a blog post on Hubitant site about network issues affect these sensors and the recommended repeaters. I bout the 4 Ikea switches and two repeaters and scattered them across the house. I replaced some Sonoff device and replaced them with these, so far it is all working. I will let you know in a week if I get the evil ā€œunavailable.ā€

Are you sure you donā€™t have WiFi interferences?
What channel do you use for WiFi and for zigbee?
I had issues like yours and it was channel overlapping

`
Since about 2 weeks i have the same problem. My xiaomi sensors (aqara / mi) after 2.5 hours seems to become unavailable but I see that they donā€™t work immediately.
I checked several things:

  • wifi / zigbee interference
  • multicast forwarding
  • device batteries
  • firmware versions and software version
  • configuration of the xiaomi_aquara component in home assistant
  • gateway xiaomi and my 11 device

and everything was ok.
With the idea of ā€‹ā€‹having to wait for a firmware or HA update, I started a new and clean home assistant on another container docker with only the configuration of the xiaomi gateway and VOILA , device works perfectly!!!
Now I have to find out what to do in the home assistant production installation without having to reinstall everything!!
`

i also ran into problems with my Aqara Gateway Light, it does exactly this behavior - light turn off after 2.5 hours repeatedly - im on Hassio 0.118, so do you have found a solution without reinstalling everything? I donā€™t have problems with the connected devices they work through this 2.5h interval but the gateway light turns unavailableā€¦

Hello,

Did you ever found a solution to it. Or have a fresh install is the only way to go.

Thanks.

Sorry, i got rid of it in the end.

Resurecting an old thread, since this issue was still a PITB for me.

A fresh install of HA with the latest version as on the day, on Intel NUC didnt solve the problem for me. Not sure now what could be the issue, the Aqara Gateway and Light and connected Aqara cuve is detected on a reboot and works fine, however becomes unavailable after 2.5 hours. Not sure is it due to having two VLANs on my home network config, as other devices do interoperate well between the VLANs.

To make a similar solution like all other buggy integrations (which I read across in a number of threads in the community) , i resorted to the solution of restarting the integration whenever it becomes unavailable.

Have created the following automation and waiting it to be fired for the first time to prove its success. Maybe someone in a similar dilemma can find this useful

alias: Restart Xiaomi Aqara Gateway Integration
description: >-
  Restart Xiaomi Aqara Gateway Integration after it becomes unavailable every
  2.5 hours by checking light availability status
trigger:
  - platform: state
    entity_id:
      - light.gateway_light_7811dcfabff2 (replace with your device entity ID)
    to: unavailable
    for:
      hours: 0
      minutes: 0
      seconds: 3
condition: []
action:
  - service: homeassistant.reload_config_entry
    data:
      entry_id: a40da9995a053550524cde628cb59fdd (replace with your GUID from config/.storage/core.config_entries)

mode: single

Use this thread to find the IDs for your devices.

Make sure you differentiate between device_ID, entry_ID and entity_ID as it was a bit confusing and overlapping for me at first.

The automation checks the entity ID of the aqara gateway light and if it becomes unavailable for 3 sec, it reloads the integration for entry_ID of the Aqara Gateway.

Hope it becomes useful.