ZHA loses Aqara sensors after power outage

Every time the power goes out long enough for the UPS to run dry and Home Assistant to shut down the following events occur. When everything comes back up all the Aqara sensors will be missing. To bring them back I have to go to every Aqara device (1 temp/humidity, 2 motion sensors, 1 door switch) and hold the pairing button for a few seconds with ZHA in add device mode. ZHA will find them, and show the new device screen with all the old information filled in, and the sensor will be back and running fine until the next power outage.

I have tried leaving them be for a while to see if they will check in and re-add themselves, but they do not.

They are farther away than the Peanut switches that are all over the house. So I think they usually connect through the Peanut mesh.

I’ve tried getting the ZHA map to work and have had no luck (really wish ZHA Z-wave graph were either part of the integration or were in the add-on store) so I’m not sure what my mesh looks like.

I’m on the .108.3 HA
I’m using a conbee II stick.
I have forced my router to not use channel 11.
My zigbee network is mostly Peanut switches that have been upgraded to the latest firmware (so they have power monitoring).


I have a bunch of Aqara door sensors and buttons and I have the exact same problem. No advice for you unfortunately, just hopping on the train.

Any new News about this issiu?

From my research it appears my problem may be the Peanut switches I use for power monitoring.

Just wondering, do you have zigbee devices that are not aqara?

Currently i have a Conbee 2-Stick with 2 Aquara Smart Plugs, 1 Ledvance Smart Plug and 2 Aquara Door-/Window sensors with the ZHA Integrations. Every Time i restart Home Assistant and the Door-/Window sensors are not in the near from the Conbee 2 Stick the sensors state change to “nicht verfügbar” .But the Device is still in Home Assistant availaible. The manfacturer changed to “unk_manufacturer” and modell to “unk_modell”. I have to pair the Aquara sensors (LUMI lumi.sensor_magnet.aq2) again.

Before i activate the pairing mode and pair the device again i can see this log message every time the sensors physical change there state.

"Ignoring message (b'18180a00001001') on cluster 6: unknown endpoint or cluster id: 1"

Also the “zuletzt gesehen” on the ZHA Device page is working correctly and got the new date every time the sensor physical change the state.

But in Home Assistant the State from the sensors are still “nicht verfügbar”

The zha.storage-File also have the correct values:

    "data": {
        "devices": [
                "ieee": "00:21:2e:ff:ff:05:de:21",
                "last_seen": 1598092920.7177558,
                "name": "dresden elektronik ConBee II"
                "ieee": "04:cf:8c:df:3c:79:cd:28",
                "last_seen": 1598121509.826523,
                "name": "LUMI lumi.plug.maeu01"
                "ieee": "04:cf:8c:df:3c:79:ce:51",
                "last_seen": 1598121533.7245374,
                "name": "LUMI lumi.plug.maeu01"
                "ieee": "f0:d1:b8:00:00:13:6a:de",
                "last_seen": 1598121118.73059,
                "name": "LEDVANCE Plug Z3"
                "ieee": "00:15:8d:00:05:7b:44:10",
                "last_seen": 1598124143.3405344,
                "name": "LUMI lumi.sensor_magnet.aq2"
                "ieee": "00:15:8d:00:05:7b:43:7e",
                "last_seen": 1598090292.2723129,
                "name": "LUMI lumi.sensor_magnet.aq2"
    "key": "zha.storage",
    "version": 1

I enabled the Debug-Log but i am not familiar with entries.

  default: warn
    homeassistant.components.zha: debug
    bellows.ezsp: debug
    bellows.uart: debug
    zigpy.zdo: debug
    zigpy.application: debug
    zigpy: debug

The Log have too many characters for that forum:

Just had the same thing happen to me. My only Zigbee device right now is this aqara motion sensor. It’s plenty close to communicate with my HUSBZB-1, but after a power cycle it wouldn’t reconnect on its own. Told ZHA to look for devices and put the sensor in pairing mode manually and it was immediate recognized and old configs applied. This thread was helpful for that part, but I’ve got about 20 of these devices on their way from China and I’m not looking forward to having to re-pair every one of them anytime I need to do maintenance or have an idea unexpected power outage. Even with battery backup it still shuts things down gracefully.

one year later and the same problem for a bunch of zigbee devices. any news on this? does this happen for deconz or zigbee2mqtt as well?

@snikay I have never had this problem with Z2M, though I can’t remember the last time I actually powered off my Raspberry Pi, I have a ZigBee HAT and not a USB stick. I’ll have to try a power off and power on to test how things come out. Just a reboot of my Raspberry Pi doesn’t affect my ZigBee devices. I have a variety of Aqara/Sonoff/Sengled/Tuya ZigBee devices.

I have z2mqtt and have 12 total aqara devices (motion, open/close, temp/humidity). I’ve lost power numerous times and havent lost pair because of it. I did, at different times, have 2 motion sensors just choose to lose pairing on their own though

for me, some devices even losing connection after simply changing the batteries :smiley: repeatable …

guess i’ll switch to zigbee2mqtt. seems more stable. (damn… that’ll be annoying ^^)
thank you guys