WTH Delete devices from GUI

@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

1 Like

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.

Thanks for the feedback <3 !

1 Like

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.

1 Like

So the moral is post an issue on github, or better still, a PR :slight_smile:

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.

8 Likes

Hi,

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 :slight_smile:

Thanks in advance!

2 Likes

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…

PLEASE someone advice on how to use that function

1 Like

Hi There
The same problem with removing devices.
Help!

Did you follow the advice in the docs?

1 Like

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?

I found a solution that works to me on another thread here:

deconz.remove_orphaned_entries

with this i found out that i had 21 old devices (most unknown) which was deleted, too.

4 Likes

Nobody mentioned ASUSWRT devices here.
There is a use case here:

  • my iPhone 5S was added as a device «iPhone 5S» with device_tracker.iphone_5s;
  • then I had to restore my iPhone, now it is called «iPhone» - and a new device “iPhone” is created with device_tracker.iphone ;
  • then I renamed my phone back to «iPhone 5S»;
  • now I need to remove that extra «iPhone» device (which is always «Away») - and cannot do it via GUI.

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

Then there is a solution:

You delete a device in Deconz.

Then you add it in ZHA, it appears Deconz + ZHA

You delete it from ZHA and it deletes it from Deconz

You add it again in ZHA and it is OK

This did the trick. Thanks!

1 Like

This works perfectly

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.

1 Like

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.

thank you for this!