@Robban Devices! Not entities
The problem is very very straight forward. There is no way you can delete a DEVICE.
Once added it stays forever unless you delete the entire integration. Or hack the JSON file. There is nothing special to look for in logs.
Delete a light bulb in Phoscon. And then try and delete the light in Home Assistant. You can delete Entities related to the device if it is unavailable. But you cannot delete the device itself. It is not only Deconz that has that problem. It is the same with device trackers etc. Once a device is added there is no user interface to delete it again. It stays as cruft. And the problem besides being cruft is that it prevents adding a new device with the same name. Then you have to rename the old to some garbage name and restart Home Assistant.
The two typical normal everyday use cases are
-
I have a Zigbee device that I no longer need. I remove it in Phoscon. I want it removed in Home Assistant.
-
I have a Zigbee device that is broken. It is dead or unstable. I want to replace it with a new similar device. I remove the old from Phoscon and I add a new giving it the same name as the old. And the end result I want is that things work like before the broken light bulb was replaced. I want my Device name and the Entity names the same as before.
The latter case is what gives the most grief. The old Device and the new Device are both in Home Assistant now. The new device will have entity names autogenerated to be _2 appended.
So you can go to the old device and delete the entities. And then you can rename the new entities by removing the _2. Well actually you cannot until you have restarted Home Assistant. You end up with something working with these extra steps. But you still have that old original Device record in the JSON and it still shows up as a device when you look at thr Deconz integration. The only way to get rid of it is to stop Home Assistant. Edit the .storage/core.device_registry JSON file. And then start Home Assistant again.
The elegant solution will be that removing a device from Phoscon also removes the Device in Home Assistant. But that may be dangerous for the edge cases where people need to remove and readd the integration. Be careful with that.
I would personally be happy if the UI of Home Assistant had a delete link for Devices the same that is already implemented for Entities.