Force XBee3 Zigbee to leave an PAN and be forgotten entirely

I am using an XBee3 with the latest Zigbee firmware (1012) as an end node an wanting to join a coordinator that is a ‘SkyConnect’ dongle connected to my Home assistant node with the ‘ZHA’ integration.
While I’m debugging the MicroPython code, I’m wanting to be able to go through the full network join, configure, run and then leave cycle.
Everything works well for the first part as long as the PAN ID (the “MY” parameter) is 0xfffe. However I can’t seem to force to back to that state once a PAN ID has been assigned.
I’ve tried the ‘NR0’ and ‘NR1’ commands and the ‘CB4’ command the PAN ID stays the same.
What is to ‘correct’ was t have the XBee3 Zigbee end node leave the network and also make sure that the coordinator forgets all about it?
(BTW I’m also asking on the ZHA forum how to force the coordinator to forget this end node - my device doesn’t show in the ZHA display but it may be ‘hiding’ somewhere that somehow makes the XBee3 rejoin without going through the configuration steps.)
Susan

There is not a way on the End devices side to do that. At least not that I am aware of. You might want to check the Zigbee HA profile to see if there are any ZDO commands to do what you want.

Just to complete this thread - the Home Assistant ZHA integration does have the capability of removing an end node from the network given its IEEE address. (Make ZHA forget a device - #3 by mamoel - Zigbee - Home Assistant Community)
Susan

It seems like you’re working on configuring an XBee3 Zigbee end node and facing issues with rejoining the network after assigning a PAN ID. To force the XBee3 to leave the network and reset the PAN ID, you can try the following steps:

  1. Use the ATNR0 command to reset the node to factory defaults, which should clear the PAN ID.
  2. After resetting to factory defaults, configure your XBee3 with the desired PAN ID (e.g., ATID0xFFFE) before attempting to join the network again.
  3. Make sure to save your configuration changes using the ATWR command to ensure they are stored.

The NR0 does not clear the PAN ID to factory defaults. The NR command is a Network reset. It tells the radio to leave its current network and to try joining a network based off of the PAN ID set within the modules ID field.

If you want to restore a setting to defaults, then you need to either sending an ATRE, or issue the command with the default value. In this case, ATID0. Then issue a local network reset (ATNR0).