Aqara temperature sensor is leaving network every few days (Zigbee2Mqtt)

Hey community,

I’ve a smart home with some z-wave and zigbee devices. The number of zigbee devices is 26 and almost all of them a working well. But unfortunately there is one Aqara temperature sensor is very unstable. It is leaving the network every few days with no reason. Battery is new.
I have to re-join it then which is very annoying, because it’s not very simple with this sensors. Furthermore, there are some automations depending on that sensor, and they are out of order very often now.

There is one special thing about this sensor compared to the 5 other identical sensors:
I’ve first placed it at the other corner of the room, but was very unsatisfied about the results (next to a window), so I replaced it about a month ago. After that the issues where occurring the first time. The sensor stated empty battery after the replacement, which was very strange because it was a relative new one. So I switched them with another sensor (which is now showing empty battery since a month, but is still working well, seems to be some software issue with the sensors).
Then it worked for some days, but suddenly the sensor was not part of the network anymore.
I rejoined, and it worked again, just to leave the network again after some days. The same procedure repeated now the third time.

Do you have any idea what could be the issue? I have no idea how the sensor is connected to the controller, since the creation of the map in Zigbee2Mqtt is not working for me (loading forever). But the sensor is only 2 meters away from the controller.

My controller is a SONOFF Zigbee Gateway EFR32MG21 + CH9102F.

Thanks in advance.

1 Like

In case you have multiple routers you might want to try to only enable joining with the closest router, not with all. That forces the device to pick the right one. If I remember correctly, zigbee devices prefer a router as long as it’s connectable, no matter how bad the connection. It’s not like a cell phone network or wifi mesh where you’re automatically reconnected to the closest antenna. So maybe that device is connecting via a router that’s very far away, with the connection dropping off from time to time?

Hey,
thanks for the answer.

I restarted the raspberry PI and tried again to create the map in the UI. This time it worked. The Aqara sensor is connected to a Innr Plug, which is connected to the controller. The distance is about 1 meter.

But I had this plug disconnected for a few days the last time (but not in the other cases).

  1. Does it mean, that a leaf-node is not searching for a new router after it got disconnected? It just says goodbye forever?
  2. What if a remove a plug in the center of the network? Does it mean I have to re-join all the devices?
  3. Isn’t there some phase, where the network is “healing” itself and re-arranging it’s nodes automatically?

With my Z-Wave devices I never had these issues and they never had an issue with removed devices, it’s just taking another node as router in case of lost link. That worked for years now.
But unfortunately I decided a few months ago to focus more on Zigbee, since the devices are cheaper and there are much more available devices available (at least in Germany).

Device with issues:

You are not alone, “Xiaomi devices do not fully comply to the Zigbee standard, it sometimes happens that they disconnect from the network.”, more info here: Xiaomi WSDCGQ12LM control via MQTT | Zigbee2MQTT

I have like 30 aqara devices (door contact, T/Hr, plugs, curtains, pir…), and sometimes they got disconnected. When this happens, just enable the “permit join” in z2m and push once the pairing button and it will reconnect again.

If you have the option availability enabled in z2m (settings->availability), what helps (at least in my network) is to increase the timeout, with a timeout of 1440 for battery devices and 120 for main powered ones.

1 Like

I’ve changed the availability settings in Z2M, thanks :slight_smile:

Yesterday evening I’ve re-joined the sensor again, but today in the morning it has left the network again. I’ve not removed the router in the meantime. I absolutely don’t know what the issue is. Are there any Logs in Z2M?

I’ve re-joined it again today, manually with the controller this time. Now it’s still available in Z2M with a LQI of 255, but in the map it’s not connected to any node.
And in HA the device is missing at all. Is there a way to re-add a device when it’s missing in the mqtt integration? I’ve already reloaded the integration, didn’t helped.

Aqara sensor is a strange device but very reliable if you get it to pair correctly. They won’t disconnect when pairing to sonoff or IKEA routers. I have a handful in my house and they don’t like changing router but will only work with sonoff and IKEA routers in my house.

In the meantime, I’m pretty sure it’s an Z2M issue and not an Xiaomi issue…

After the sensor was stated as online with LQI of 255 in Z2M the whole day, but no updates were sent, I’ve decided to fully remove the device from the network.
Then I’ve replaced the almost new battery with a new battery and joined the device to the network (allowing only joining to controller) using the long-press on the Aqara device.

The interview was successfull, updates were working and LQI was about 190. But the device was shown as offline in Z2M!!! While receiving updates, Z2M showed it as offline? What the…?

But okay, I then renamed the cryptic name to the old name of the removed device and BAM: The device was online again… BUT: LQI 255, no updates anymore and no connection to any node in the map. Again the same issue like before with the removed configuraion…

Am I stupid?

Brilliant, the sensor left the network again…

I wish I would have decided to invest more money and use Zwave devices only. ZwaveJS is working stable since years now…

And now 2 of my LED devices are broken, too. I’m crying :sob:

I wasted almost a month with what you are going through now. Just get an IKEA router or a sonoff dongle and pair the Aqara to it or get rid of the Aqara temp sensors.

I have a SONOFF dongle…

Is there any alternative to Zigbee2Mqtt? It should be able to run in docker on a RaspPi, independent from HA, since HA is running on a Synology NAs which is not allowing USB devices.

Sonoff dongle as a router or coordinator? You need to flash it as a router.
You can try ZHA but it won’t help you because Aqara is not following the zigbee standards. If the router route is not something you want them there is also the Aqara hub you can get.

Edit : just to be clear. I am using the Sonoff dongle P as the router. There is the newer E version out there but I have no clue how reliable it is.

The SONOFF dongle is the coordinator (I think I have the newer E version). I have to other routers in use except from power supplied devices.
ZHA is not an options, since it’s not a standalone solution.

I’m now not able to re-join the device anymore. It’s blinking 3 times every few seconds and is not responding to the button press anymore. Maybe it’s completely broken now.

You can always delete the device in zigbee2mqtt, reboot HA and reset the Aqara by holding the button for 5+ seconds.

No because:

  1. It has removed itself from the network, so I’m not able to delete the device in Z2M (it’s not in the list anymore)
  2. Why HA?
  3. Pressing the button for 5 seconds leads into no reaction. Normally it blinks afterwards, but this device doesn’t. It just doing it’s 3-time-blinking after a regular period.

Rebooting HA just in case it’s on a weird state and having ghost device because the 3 blinking lights probably mean it’s successfully connected to something.

My Z2M network is almost completely Aqara products (about 15-20 sensors and wall plugs as routers). Unsure if the antenna in the Raspi/HA is currently SkyConnect or Sonoff. My issues with Zigbee are most frequently caused by weak batteries. I do have at least one Aqara wall plug in each room though, making the network more stable.

PS: Thread is even worse, as there are less diagnostic options in HA.

What you could try is also completely remove the temperature sensor in your bedroom from Z2M, install the “new” sensor there and see if it works there. If it’s still causing problems, the device might be faulty. But if the bedroom-sensor now fails to work in the other room, you know it’s related to the room and network.

I have exactly the same issue, though I’m using it with Conbee II stick and Deconz integration. My Zigbee network seems to be rock solid, with no issues except this one. I have 80+ devices on my network, 20 being Aquara, 6 this particular temperature sensor.

This is also the symtom I experience (unlike any other of these sensors), so I start to believe it might be somehow faulty.
Or perhaps it is possible somehow to reset the sensor to factory settings and add again as fresh? Simple readding now makes it only to work for day or two…

I’ve removed the batteries completly yesterday and leave them out over night. Today I was able to join it to the network again. Till now it’s working stable. Let’s see. Maybe that was some kind of reset.