I removed the node zwave.pir_gang some days ago, and I have verified it´s not listed in the states view, or in the Z-Wave Node Management UI section. Even so I cannot add a new node using the same identity_id.
The new node is added OK, but when changing its identity_id to zwave.pir_gang an error message appears; save failed: Entity is already registered.
How can I completely remove the remembrance of the old node?
Unfortunately, you have to manually go through some files and remove the residues.
Check the core* files in the .storage folder. They contain the device and entity registry. Shut down HA, make backups, adapt the file(s) then start Ha again. Afterwards you can use the entity IDs again.
Had to do this myself after recreating my zwave network…
Yes, the device file contains the devices that you see on the integrations page and the other the actual entities. They reference the device they belong to , though. So make sure to delete all the entities of the devices you remove to preserve referential integrity.
Not sure how graceful HA is with unexpected content like IDs of non-existent stuff.