WTH Delete devices from GUI

This Delete individual device (and entity) from integration

The linked issue is regarding mqtt but I have the same problem with removed deconz devices.

Would be nice to not have to edit config/.storage/core.device_registry manually in order to delete individual devices from an integration.

I don’t think the devs will ever support editing anything in .config/ by hand

Yes, I know.
Thats why it would be nice to have an option to delete individual entities from the GUI instead.
Or am I misunderstanding your comment?

1 Like

No, I probably misunderstood yours :slight_smile:

1 Like

Entities can be deleted from the GUI.
Devices cannot be deleted from the GUI.

That’s indeed a WTH thing. I recently had to stop HA and edit the devices file in .storage to get rid of some old devices. Would be great if this can be done in the GUI.

Please edit the title so it shows devices and not entities :+1:t2:

2 Likes

Thanks! I meant devices. I have changed to devices everywhere. :slightly_smiling_face:

The idea is that devices are fully managed for you. They get created by integrations and get automatically removed when an integration is removed. If an integration is changing the devices it exposes (ie you remove a Hue bulb), it’s up to the integration to clean it up. If this doesn’t happen, it’s a bug! Integrations should clean it up. For MQTT we realized that this didn’t work, and so for MQTT there is a delete button.

Deleting a device that is still “active” will re-appear on reboot.

2 Likes

I understand your point and I (probably) agree. :slightly_smiling_face:
Then it is a bug in the deconz integration that needs to get fixed. Who is maintaining the deconz integration? Since it is a “component” integrated in HA I guess it could qualify for WTH month?

2 Likes

The only integration I can remember having a delete device feature is the Mobile App (IOS) where I happily found that buying a new iPhone did not mean hacking JSON files. And that is a new thing added recently

How many Home Assistant Developers does it take to change a light bub? 10001. One to hold the light bulb and 10000 to turn the house around. Yes old joke.

How do you change a Philips Hue light bulb running in Deconz in Home Assistant?
Deleting it from Phoscon does not remove the device from Home Assistant. It lives on as a dead device forever. The only user interface way to get rid of it is to delete the entire integration which deletes all devices and all entities. And when you add it again, God save you if you had renamed any of the devices or entities. You will have a mess to clean up an hour in automations and Lovelace UI elements.

Another unacceptable way is to rename the old device to some dummy name and accept that your Home Assistant installation gets polluted with more and more no longer existing devices. I would have at least 50 dead devices like that now.

If you want to remove 1 device from the Deconz integration you have to delete the item from .storage/core.device_registry and restart Home Assistant while you pray that you did not miss a comma or deleted one to many. And then you can add the new device to Phoscon. And you have to do it in that order because you cannot name the new devices the same name as the old without getting _2 appended to all entities and then all your automations and Lovelace UIs are screwed.

It is really yet another light bulb joke the way this works in Home Assistant.

I have personally had to do this several time just the past few weeks. I have had a couple of light bulbs burn out on me. They do not last forever. And I keep on replacing remote controls with newer nicer models. We home automaters always tinker with things. It is in our DNA. I have Zigbee lights and Zigbee sensors, and Zigbee sensors in the entire house (“Oooh the Zigbee”). 98 Deconz devices with its 142 entities. So there are always things that get changed or break down.
So I end up hacking that darn .storage/core.device_registry several times per month.

It is only the integrations that add multiple devices that are a problem

For example my Logitech Squeezebox integration adds one device. It is not a problem deleting this device by deleting the integration.

The problem in my installation is the Deconz integration and the Unifi device tracker integration.

There is a missing user interface element in these two integrations that allows deleting a device.

@balloob Does Home Assistant even offer a Lovelace UI feature for the integrations to add a button for deleting a device? Is there an API for an integration that can remove a single device? I find it strange that NONE of the multi-device integrations I have tried have the feature. And non have made a custom component. I agree that it is the integrations that need to handle deleting devices. But are the APIs and UI elements even available to the integration authors?

There are two feature proposals for this

which was closed with the wrong reason. The person closing it mixed up deleting entities and deleting devices.

And then a new was opened

I cannot understand why HA only focus on adding a device and misses the feature of removing a device again without - like in my case - deleting 98 devices and 142 entities.

I read many of the WTHs. This is the most important one in my view.

4 Likes

:point_up_2: It’s a bug in Deconz.

1 Like

And in Unifi devicer tracker
And in the MQTT integration if you have auto discovery enabled (which I have not for this very reason)

So we raise bug reports for these and quote you that it is a bug and not a feature request?

What about when an integration has many devices and I only want to delete one device?

Do I have to delete the whole integration and start again?

In the mqtt integration I can remove devices just fine.

Maybe there needs to be better documentation around this? It isn’t obvious to a user that this is the case. But where does it go? This page titled devices is about adding integrations. Then the last example is about entities, but still calls them devices. I can submit a PR to clear this page up. But it is unclear to me where the documentation on actual devices lives.

https://www.home-assistant.io/docs/configuration/devices/

I myself spent a long time wondering why my mobile app integration had two devices for my phone and why I could not simply delete the old device that was orphaned with no entities.

1 Like

Bug report raised.

There were additional bug reports but specifically related to not being able to delete group devices (which are just light devices in Deconz)

and in this closed bug report it is confirmed that you have to delete entire integration with some note about being fixed in next release. Obviously this did not happen since we still complain about it

2 Likes

Others should raise bug reports for additional integrations. Make sure to raise it against the integrations and not the addons.

I use the MQTT integration but with auto discovery disabled so I cannot confirm if this is still buggy. Can some of you with that problem confirm and raise bug reports against it?

I remember Philips Hue integration having same issue. But I have thrown out my Hue hub and gone all in on Deconz. So I cannot confirm that one either. Can you delete a device in the Hue integration? Does it get auto deleted if you remove it from the Hue hub?

My reasoning towards this


If I update a device name (ex - because I moved a light switch to different room) through the device manufacturer app/web service/etc, HA does not update the entity_id/friendly names/etc to reflect the new name.

If I could delete the HA device, restart, the integration should recreate the device and entities to reflect the new name.

At least in this use case, you can rename the device in Phoscon.

And after that renames the device in Home Assistant. Both device and entities. There is a user interface for it. And actually for Deconz adding a device causes it to be pulled into Home Assistant when it is discovered with its default name. You can rename it all you want in Phoscon. You still need to go to HA and rename it there.
Exception is event names. They update as they are actually not stored as entities. They exist when the event happens and that is it. But the battery sensor name will be some default you have to rename after adding it

So this use case is actually not an argument why we need to be able to delete devices.

You could argue that renaming a device in Phoscon should rename it in Home Assistant. That could become a major breaking change for many of us that have renamed entities to an overall naming scheme. I am not sure I would like that.

UniFi integration should clean up after it self when the user remove a client from the controller.

funny thing at my system when using deconz integration and unifi integration is that when clicking on the deconz integration and the filter is filtered on ‘deconz’ it is also showing the unify controller in te list :stuck_out_tongue: