Zigbee Door Sensor Fails to Join Network, Stuck in Configuration Stage After Resetting and Re-joining with ZHA

Hello everyone,

I am trying to add a Zigbee door sensor to my Home Assistant (HA) system and have encountered some issues. Here is the problem and the steps I have taken:

Problem Description:

  • My Zigbee door sensor failed to join the network on the initial attempt, specifically during the configuration of the child device stage.
  • I attempted to reset the device locally to leave the network and observed that the child device successfully sent a leave packet.
  • Afterwards, I used Zigbee Home Automation (ZHA) to re-join the network, which resulted in a new short address 0xBEC5, but the joining process is stuck in the configuration stage. Packet sniffing revealed that ZHA keeps trying to send read/write attribute packets to the previous short address: 0x790A, with a very large number of packets. It is not sending any packets to the new short address 0xBEC5.

Questions:

  • Has any developer encountered a similar situation before?
  • Could this be a bug in ZHA?
  • If so, how should I report this issue?
  • If not, are there any recommended solutions or further debugging steps?
  • Since it’s an English forum, I would like to ask for your help in translating this post.

Thank you for your help and suggestions!

It can of course always be a bug in ZHA (though that is a way less common occurence than you might think). Lets start with what exact Zigbee device product/model you have (preferably the full Zigbee signature, also known as Zigbee fingerprint)? There is a good chance to find more known issues if we know exactly that Zigbee device product/model you have as then we can do a search on the model and/or Zigbee signature.

If it is a battery-powered device and it is within range with no reception problems (and you have no issues with EMI/RMI/EMF interference) then it could be an issue that the device goes to sleep (i.e. a “sleepy device”) before it fully finishes the pairing process (initialization and interview). It is known that some sleepy devices can be tricky to pair and you sometimes manually have to keep them awake during the whole pairing process.

Regardless, at least some of the symptoms you describe are also normally seen when you have problems with EMI/RMI/EMF interference and when you do not have enough Zigbee Router devices (or a combination of those two root causes), as such you should not bother with troubleshooting any deeper or reporting any issues before you have first done everything you can to take all actions on recommendations and tips in this guide, as more commonly than not such symptoms will usually go away once you have just followed all those as best practice:

Only if you have already followed those all tips should you take the next step of reporting the issue, see troubleshooting section in the official ZHA documentation (which also contains summeries of those tips):

Note: FYI, ZHA integration issues should be reported to the Home Assistant core repository on GitHub:

PS: @luobenwang Kudos on a great first post! You are an IT-professional or developer I assume, or?

I should perhaps add that if need urgent workaround you could also try manually remove the device from the Zigbee network (on the Zigbee Coordinator) using zha.remove action (with ieee address as data argument) under the Developer Tools, before trying to re-pair the device again, but you should not really have to so, as if you have to do that then I think it is a greater chance it is a bug in ZHA dependencies and then it would be better for everyone if you report it as an issue as that way it can be properly analyzed by zha developers who can maybe fix the root cause and prevent the same thing from happening to others in the future. This method is discussion here:

https://community.home-assistant.io/t/zha-can-not-remove-device/256338/

Hello Hedda,

I hope this message finds you well. I’m reaching out for some guidance on a Zigbee device integration issue I’ve encountered with Home Assistant’s ZHA. Your insights could be just what I need to resolve this challenge.

Here’s a rundown of what I’ve got going on:

  1. Interference Check: I’ve confirmed that my door sensor is free from EMI/RFI/EMF interference, as it’s operating within a close 1-meter proximity to the Zigbee coordinator.
  2. Pairing Strategy: To ensure a smooth pairing process with ZHA, I’ve set my device to remain active for a full 70 seconds after the initial pairing. This should provide ZHA with sufficient time to read the device’s attributes and complete the configuration.

However, I’ve hit a snag:

When I issue a Zigbee “leave” command, reset the device, and have it rejoin the network, ZHA assigns it a new short address (0xBEC5 this time). But, ZHA continues to attempt attribute reads at the device’s previous short address (0x790A), seemingly caught in a loop of sending numerous messages to the old address. This behavior prevents the device from completing the reconfiguration with the new address.

This issue has been quite perplexing, but I’m pleased to report that the device pairs seamlessly with Alexa and Zigbee speakers without any such issues.

I’m keen on sharing the Zigbee capture logs and Home Assistant logs with you for a more detailed analysis. Could you advise on the best method for presenting these logs for your review?

I would greatly appreciate any advice or suggestions you can provide!

Best regards,

Again, if you have already followed those all tips should you take the next step of reporting the issue, see troubleshooting section in the official ZHA documentation (which also contains summeries of those tips):

Note! ZHA integration issues should be reported as a new issue to the Home Assistant core repository on GitHub: