@robban I also want to give feedback. First thanks for addressing this really annoying problem
I have tried this a few times. It sort of works but not as I think people expect
First - I tried the feature of disabling new devices automatically. When I disaable this then I can add new devices and rename them before pulling them into HA. That is great. But once I have renamed it it is hard to pull it in. The deconz.device_refresh does not load the new device. I tried several times. I had to restart HA to get the device loaded.
Then I added the new device (a light bulb) and removed it again in the Phoscon app.
And then tried the deconz.remove_orpharned_entries and a device was removed. But not the new one. I never found out what is missing. Maybe another orphaned device I had forgotten about. Another restart of HA and then again deconz.remove_orpharned_entries and then it removed the device.
So much better. But that need to restarting HA is a bit strange. And from a UI point of view, the Deconz integration (and integrations in general) really should have the buttons visible to do these actions. Having to go to a geeky developer tool is not very intuitive. You have to know. But that is a generic HA problem.
In any case - it is MUCH BETTER than before. At least I do not need to hack JSON files when I remove Deconz device and that I am very thankful for. The rest is constructive feedback
The disabling works by just ignoring signalling from the library, the data already exist in the current structures. That device_refresh then doesn’t catch the new ones is a bug missed behavior, its probably because the service logic compares what the library knows before polling deconz manually rather than looking at what is registered in hass and not. Create an issue for this please.
Yes the removal of entities currently requires you to at the least reload the integration first, because there is no mechanism right now that updates the library based on things removed from deconz so if the library has seen the device it will be there until a reload.
The generic clean up button from the GUI is complex because there needs to be integration specific logic to handle special cases unique to each (or not) integration. Earlier the registries properly automatically removed orphaned devices when entities was removed (also on restart). But since the system needs to consider there are devices not belonging to entities (the service itself) you can’t take this general approach if you want to cover all cases.
I haven’t gotten much traction yet on exposing this per integration, I will return to this topic since I need to make sure this works properly with UniFi as well, I might talk more directly to Bram or Paulus about it, I know dmulcahey saw the relevance in implementing support for ZHA at least.
Why don’t we still have no integrated method of deleting devices from an integration. I am using the mikrotik integration and it added numerous (undesired) devices and entities when using auto discovery (now turned off to avoid further mayhem).
I have now deleted 6 times a number of entries (devices and entities) from both core.device_registry and core.entities_registry manually and even deleted all but one (in use) from known_devices.yaml. On HA restart these device are added back in again. This is a PEST if even manual deletion doesn’t work anymore.
Can somebody explain why even after manual deleting entries from device and entities registry they magically reappear and when are we going to have a comprehensive way of deleting unwanted devices.
I think this whole thread sums it up quite clear; Don’t leave this up to the integration! Instead provide a delete button which will remove any device and/or entity from the HA registry. Be it an active, inactive, dead, removed or orphan entry. Then it’s up to the user to make sure it is also removed everywhere else, otherwise it may well reappear upon the next reboot due to autodiscovery - which is just fine.
If the HA-Dev team continue to point their finger at every integration, this will be a never-ending-story.
So, put an end to it - please.
I still have the issue with not being able to remove a device…
Could someone please summarize a “step by step” how this is done using the previously mentioned services “deconz.device_refresh” and “deconz.remove_orphaned_entries”? I tried it several times with restarting the HA also. I guess I’m doing it in a wrong order or something
Using the deConz zigbee with an conbee 2 I have serious issues regarding that I needed to remove several lights from Phoscon (conbee 2 GUI app), but the devices are still visable in HA.
I tried the deconz.remove_orphaned_entries but I can only click the button on that page because I dont know if I should input more info in the command text line below that text…
Hi, i also want to delete a deconz device (motion sensor).
i deleted it in Phoscon-app.
i deleted all entities in HA and restart.
only the device is now in HA.
How can i now delete this Motion-Device in HA in the integration deConz?
This is my problem.
I am migrating devices from tuya integration to local tuya one at a time. However, I can not delete each device as I migrate it because that seems to be not supported by the tuya integration. Super inconvenient
The thinking from the devs’ side seems to be that integrations should be allowed to stuff devices and entities down HA users’ throats whether said devices/entities add any value to the user’s experience or not. If an integration adds devices it shouldn’t, fine; that’s a bug and it should be reported to the codeowner. Meanwhile, users are stuck with non-functional devices they don’t want without any means of remedying the situation themselves.
Dear HA dev-team, I love you guys and admire your work immensely, but I just don’t understand this one. Please allow us to curate or own collection of devices and entities.
You should be taking this up with the integration in question. You can delete or remove discovered devices if the integration itself set it up to do so.