Aqara door sensor works for a minute after pairing then gets stuck in the last state

I have a some lumi.sensor_magnet.aq2 (not the new E1 model) which were working fine a few months ago before being put into storage during a reconfiguration.

Adding them again via ZHA gui works but the sensors will only respond to open/close movements for a few seconds before getting stuck in the “off” / “closed” state. The same is happening with multiple devices of the same model. I’ve tried deleting the problematic devices via ZHA, waiting a few minutes, completely rebooting the host, then re-adding but that still fails with the same symptoms.

Other Zigbee devices including Aqara buttons, motion sensors, and Sonoff mains power switches are working fine.

My system is running core-2021.11.1 supervised with a Nortek HUSBZB-1 coordinator. The devices are only about 5m away and the network map shows the devices linked directly to the coordinator, not through a router.

4 Likes

Update
It’s not actually “a few seconds” but exactly 1 minute when it stops responding. Paired at 2:30:47 and stuck at 2:31:47 to the second.

It doesn’t get stuck in the “off” state, but whichever state it was in when it got stuck. In this case it got stuck in the “on” state.

I’ve also tried removing any router-capable devices to link the sensor directly to the coordinator but the problem persists.

Here’s the pairing log:

[0x0000:zdo] ZDO request ZDOCmd.Mgmt_Permit_Joining_req: [60, <Bool.false: 0>]
[0x7927:1:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=231 command_id=Command.Report_Attributes>
[0x7927:1:0x0006] ZCL request 0x000a: [[Attribute(attrid=0, value=<TypeValue type=Bool, value=Bool.false>)]]
[0x7927:1:0x0006] Attribute report received: on_off=0
[0x11ed] Delivery error for seq # 0x38, on endpoint id 0 cluster 0x0034: message send failure
Sending 'zdo_leave_req' failed: [0x11ed:0:0x0034]: Message send failure
Device 0x11ed (00:15:8d:00:04:1c:ae:f4) left the network
New device 0x11ed (00:15:8d:00:04:1c:ae:f4) joined the network
[0x11ed] Scheduling initialization
Tries remaining: 3
[0x11ed] Requesting 'Node Descriptor'
Tries remaining: 2
[0x11ed] Extending timeout for 0x3d request
Device 0x11ed (00:15:8d:00:04:1c:ae:f4) joined the network
[0x11ed] Scheduling initialization
[0x11ed] Canceling old initialize call
Received frame on uninitialized device <Device model=None manuf=None nwk=0x11ED ieee=00:15:8d:00:04:1c:ae:f4 is_initialized=False> from ep 0 to ep 0, cluster 19: b'\xb6\xed\x11\xf4\xae\x1c\x04\x00\x8d\x15\x00\x80'
[0x11ed:zdo] ZDO request ZDOCmd.Device_annce: [0x11ED, 00:15:8d:00:04:1c:ae:f4, 128]
Tries remaining: 3
[0x11ed] Requesting 'Node Descriptor'
Tries remaining: 2
[0x11ed] Extending timeout for 0x3f request
Received frame on uninitialized device <Device model=None manuf=None nwk=0x11ED ieee=00:15:8d:00:04:1c:ae:f4 is_initialized=False> from ep 1 to ep 1, cluster 0: b'\x18\x00\n\x05\x00B\x16lumi.sensor_magnet.aq2\x01\x00 \x03'
[0x11ed] Received ZCL while uninitialized on endpoint id 1, cluster 0x0000 id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=0 command_id=Command.Report_Attributes>, payload: b'\x05\x00B\x16lumi.sensor_magnet.aq2\x01\x00 \x03'
[0x11ed] Uninitialized device command 'Command.Report_Attributes' args: [[Attribute(attrid=5, value=<TypeValue type=CharacterString, value=lumi.sensor_magnet.aq2>), Attribute(attrid=1, value=<TypeValue type=uint8_t, value=3>)]]
[0x11ed] Found 'MagnetAQ2' quirk for 'lumi.sensor_magnet.aq2' model
[0x11ed] Canceling old initialize call
Device is initialized <Device model='lumi.sensor_magnet.aq2' manuf='LUMI' nwk=0x11ED ieee=00:15:8d:00:04:1c:ae:f4 is_initialized=True>
Checking quirks for LUMI lumi.sensor_magnet.aq2 (00:15:8d:00:04:1c:ae:f4)
Considering <class 'zhaquirks.xiaomi.aqara.magnet_aq2.MagnetAQ2'>
Found custom device replacement for 00:15:8d:00:04:1c:ae:f4: <class 'zhaquirks.xiaomi.aqara.magnet_aq2.MagnetAQ2'>
[0x11ed] Was quickly initialized from 'zhaquirks.xiaomi.aqara.magnet_aq2.MagnetAQ2' quirk
device - 0x11ED:00:15:8d:00:04:1c:ae:f4 entering async_device_initialized - is_new_join: True
device - 0x11ED:00:15:8d:00:04:1c:ae:f4 has joined the ZHA zigbee network
[0x11ED](lumi.sensor_magnet.aq2): started configuration
[0x11ED:ZDO](lumi.sensor_magnet.aq2): 'async_configure' stage succeeded
[0x11ED:1:0x0000]: skipping channel configuration
[0x11ED:1:0x0001]: skipping channel configuration
[0x11ED:1:0x0006]: skipping channel configuration
[0x11ED:1:0x0006]: skipping channel configuration
[0x11ED:1:0x0000]: 'async_configure' stage succeeded
[0x11ED:1:0x0001]: 'async_configure' stage succeeded
[0x11ED:1:0x0006]: 'async_configure' stage succeeded
[0x11ED:1:0x0006]: 'async_configure' stage succeeded
[0x11ed:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=True is_reply=True disable_default_response=True> manufacturer=4447 tsn=1 command_id=Command.Report_Attributes>
[0x11ed:1:0x0000] ZCL request 0x000a: [[Attribute(attrid=65281, value=<TypeValue type=LVBytes, value=b'\x01!\x8b\x0b\x03(&\x04!\xa8\x01\x05!\x0f\x00\x06$\x01\x00\x00\x00\x00\n!\x00\x00d\x10\x00'>)]]
[0x11ed:1:0x0000] Attribute report received: 65281=b'\x01!\x8b\x0b\x03(&\x04!\xa8\x01\x05!\x0f\x00\x06$\x01\x00\x00\x00\x00\n!\x00\x00d\x10\x00'
[0x11ed:1:0x0001] Voltage mV: [Min]:2820 < [RAW]:2955 < [Max]:3100, Battery Percent: 48.0
[0x11ED](lumi.sensor_magnet.aq2): completed configuration
[0x11ED](lumi.sensor_magnet.aq2): stored in registry: ZhaDeviceEntry(name='LUMI lumi.sensor_magnet.aq2', ieee='00:15:8d:00:04:1c:ae:f4', last_seen=1636437584.3800182)
[0x11ED](lumi.sensor_magnet.aq2): started initialization
[0x11ED:ZDO](lumi.sensor_magnet.aq2): 'async_initialize' stage succeeded
[0x11ED:1:0x0000]: 'async_initialize' stage succeeded
[0x11ED:1:0x0001]: 'async_initialize' stage succeeded
[0x11ED:1:0x0006]: 'async_initialize' stage succeeded
[0x11ED:1:0x0006]: 'async_initialize' stage succeeded
[0x11ED](lumi.sensor_magnet.aq2): power source: Battery or Unknown
[0x11ED](lumi.sensor_magnet.aq2): completed initialization
[0x11ed:zdo] ZDO request ZDOCmd.Node_Desc_rsp: [<Status.SUCCESS: 0>, 0x11ED, NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4151, maximum_buffer_size=127, maximum_incoming_transfer_size=100, server_mask=0, maximum_outgoing_transfer_size=100, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)]
[0x11ed:zdo] Unsupported ZDO request:ZDOCmd.Node_Desc_rsp
[0x359F:1:0x0500]: Updated alarm state: 0
Tries remaining: 1
[0x11ed] Extending timeout for 0x41 request
[0x11ed:zdo] ZDO request ZDOCmd.Node_Desc_rsp: [<Status.SUCCESS: 0>, 0x11ED, NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4151, maximum_buffer_size=127, maximum_incoming_transfer_size=100, server_mask=0, maximum_outgoing_transfer_size=100, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)]
[0x11ed:zdo] Unsupported ZDO request:ZDOCmd.Node_Desc_rsp
[0x99a3:1:0x0400] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=68 command_id=Command.Report_Attributes>
[0x99a3:1:0x0400] ZCL request 0x000a: [[Attribute(attrid=0, value=<TypeValue type=uint16_t, value=156>)]]
[0x99a3:1:0x0400] Attribute report received: measured_value=156
[0x99a3:1:0x0406] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=69 command_id=Command.Report_Attributes>
[0x99a3:1:0x0406] ZCL request 0x000a: [[Attribute(attrid=0, value=<TypeValue type=bitmap8, value=bitmap8.1>)]]
[0x99a3:1:0x0406] Attribute report received: occupancy=1
[0x99A3:1:0x0500]: Updated alarm state: 1
Tries remaining: 2
[0x11ed] Already have endpoints: {0: <zigpy.zdo.ZDO object at 0x7fc5fbf3fc10>, 1: <Endpoint id=1 in=[basic:0x0000, identify:0x0003, manufacturer_specific:0xFFFF, on_off:0x0006] out=[basic:0x0000, groups:0x0004, manufacturer_specific:0xFFFF] status=<Status.ZDO_INIT: 1>>}
[0x11ed] All endpoints are already initialized: [<Endpoint id=1 in=[basic:0x0000, identify:0x0003, manufacturer_specific:0xFFFF, on_off:0x0006] out=[basic:0x0000, groups:0x0004, manufacturer_specific:0xFFFF] status=<Status.ZDO_INIT: 1>>]
[0x11ed] Already have model and manufacturer info
[0x11ed] Discovered basic device information for <Device model='lumi.sensor_magnet.aq2' manuf='LUMI' nwk=0x11ED ieee=00:15:8d:00:04:1c:ae:f4 is_initialized=True>
Device is initialized <Device model='lumi.sensor_magnet.aq2' manuf='LUMI' nwk=0x11ED ieee=00:15:8d:00:04:1c:ae:f4 is_initialized=True>
Checking quirks for LUMI lumi.sensor_magnet.aq2 (00:15:8d:00:04:1c:ae:f4)
Considering <class 'zhaquirks.xiaomi.aqara.magnet_aq2.MagnetAQ2'>
Found custom device replacement for 00:15:8d:00:04:1c:ae:f4: <class 'zhaquirks.xiaomi.aqara.magnet_aq2.MagnetAQ2'>
device - 0x11ED:00:15:8d:00:04:1c:ae:f4 entering async_device_initialized - is_new_join: False
device - 0x11ED:00:15:8d:00:04:1c:ae:f4 has been reset and re-added or its nwk address changed
skipping discovery for previously discovered device - 0x11ED:00:15:8d:00:04:1c:ae:f4
[0x11ED](lumi.sensor_magnet.aq2): started configuration
[0x11ED:ZDO](lumi.sensor_magnet.aq2): 'async_configure' stage succeeded
Device 00:15:8d:00:04:1c:ae:f4 already exists. Updating it.
[0x11ED:1:0x0000]: skipping channel configuration
[0x11ED:1:0x0001]: skipping channel configuration
[0x11ED:1:0x0006]: skipping channel configuration
[0x11ED:1:0x0006]: skipping channel configuration
[0x11ED:1:0x0000]: 'async_configure' stage succeeded
[0x11ED:1:0x0001]: 'async_configure' stage succeeded
[0x11ED:1:0x0006]: 'async_configure' stage succeeded
[0x11ED:1:0x0006]: 'async_configure' stage succeeded
[0x11ED](lumi.sensor_magnet.aq2): completed configuration
[0x11ED](lumi.sensor_magnet.aq2): stored in registry: ZhaDeviceEntry(name='LUMI lumi.sensor_magnet.aq2', ieee='00:15:8d:00:04:1c:ae:f4', last_seen=1636437613.3785496)
[0x11ED](lumi.sensor_magnet.aq2): started initialization
[0x11ED:ZDO](lumi.sensor_magnet.aq2): 'async_initialize' stage succeeded
[0x11ED:1:0x0000]: 'async_initialize' stage succeeded
[0x11ED:1:0x0001]: 'async_initialize' stage succeeded
[0x11ED:1:0x0006]: 'async_initialize' stage succeeded
[0x11ED:1:0x0006]: 'async_initialize' stage succeeded
[0x11ED](lumi.sensor_magnet.aq2): power source: Battery or Unknown
[0x11ED](lumi.sensor_magnet.aq2): completed initialization
[0x8C2B](lumi.sensor_motion.aq2): set: 0 for attr: 2 to cluster: 1280 for ept: 1 - res: ([WriteAttributesStatusRecord(status=<Status.SUCCESS: 0>)],)
Set attribute for: cluster_id: [1280] cluster_type: [in] endpoint_id: [1] attribute: [2] value: [0] manufacturer: [None] response: [([WriteAttributesStatusRecord(status=<Status.SUCCESS: 0>)],)]
[0xD2DF](lumi.sensor_motion.aq2): set: 0 for attr: 2 to cluster: 1280 for ept: 1 - res: ([WriteAttributesStatusRecord(status=<Status.SUCCESS: 0>)],)
Set attribute for: cluster_id: [1280] cluster_type: [in] endpoint_id: [1] attribute: [2] value: [0] manufacturer: [None] response: [([WriteAttributesStatusRecord(status=<Status.SUCCESS: 0>)],)]
Set attribute for: cluster_id: [1280] cluster_type: [in] endpoint_id: [1] attribute: [2] value: [0] manufacturer: [None] response: [None]
[0x359F](lumi.sensor_motion.aq2): set: 0 for attr: 2 to cluster: 1280 for ept: 1 - res: ([WriteAttributesStatusRecord(status=<Status.SUCCESS: 0>)],)
Set attribute for: cluster_id: [1280] cluster_type: [in] endpoint_id: [1] attribute: [2] value: [0] manufacturer: [None] response: [([WriteAttributesStatusRecord(status=<Status.SUCCESS: 0>)],)]
[0x99A3](lumi.sensor_motion.aq2): set: 0 for attr: 2 to cluster: 1280 for ept: 1 - res: ([WriteAttributesStatusRecord(status=<Status.SUCCESS: 0>)],)
Set attribute for: cluster_id: [1280] cluster_type: [in] endpoint_id: [1] attribute: [2] value: [0] manufacturer: [None] response: [([WriteAttributesStatusRecord(status=<Status.SUCCESS: 0>)],)]
[0x72d7:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=True is_reply=True disable_default_response=True> manufacturer=4447 tsn=199 command_id=Command.Report_Attributes>
[0x72d7:1:0x0000] ZCL request 0x000a: [[Attribute(attrid=65281, value=<TypeValue type=LVBytes, value=b'\x01!\xc7\x0b\x03(\x1d\x04!\xa8\x13\x05!\x11\x00\x06$\x01\x00\x00\x00\x00\n!\x00\x00'>)]]
[0x72d7:1:0x0000] Attribute report received: 65281=b'\x01!\xc7\x0b\x03(\x1d\x04!\xa8\x13\x05!\x11\x00\x06$\x01\x00\x00\x00\x00\n!\x00\x00'
[0x72d7:1:0x0001] Voltage mV: [Min]:2820 < [RAW]:3015 < [Max]:3100, Battery Percent: 69.5

Same problem here. I have 2021.11.3 (container version). It pairs and the open/close behavior works for a while and then stops. I deleted the device and pair it again and is always the same. This device has been working one year until now, I assumed it was a battery problem, but I have replaced it.

2 Likes

Hi!
I’ve upgraded to 2021.11.4, then I’ve deleted the device, and finally I’ve paired it. Now, Aqara door sensor works perfect! :crossed_fingers:

1 Like

Unfortunately this did not fix the issue for me. After upgrading to 2021.11.4, deleting the device via ZHA UI, rebooting the system, then re-adding the device it still freezes in the last state one minute in.

HA shows my battery at 52% but I’ll try replacing it anyway, to remove that as a variable.

Update: New battery did not help. I tried the new battery on 2 different devices and both exhibited the same problem as before.

This is really odd because powering off the entire server, waiting, then rebooting didn’t fix the problem but what finally fixed the issue was reloading the ZHA integration from the integrations page after the device froze in the last position.

It’s now been a day and 3 door sensors which were all frozen continue to work fine.

8 Likes

This actually solved my problem thanks!

1 Like

Thanks so much, that solved it for me too!

1 Like

Thank you! Reloading ZHA solved it for me too!
Home Assistant 2023.2.5
lumi.sensor_magnet.aq2
zhaquirks.xiaomi.aqara.magnet_aq2.MagnetAQ2

This solves the Problem. Many thanks!
Settings - > Devices and Services - > Zigbee Hub - > three dot (besides configure) - > Reload