How can I delete devices I dont want in HA?

Super annoying, why can’t I delete any devices that I do not want ?!?!?! :roll_eyes:
I never seen such a thing in any other automation platform…

2 Likes

Me 2, deleted the device in Deconz but I cant remove them from the integration…

I just got rid of a bunch of x10 devices that were piped in from HABridge. It really sucks that I cannot clear them entirely from HA. This seems like poor database programming to me…but who knows. Perhaps switching the DB to PostgreSQL or MariaDB would make that easier?

It is now possible for integrations to remove old devices/entities.
See github dermotduffy / hass-motioneye

        # Ensure every device associated with this config entry is still in the list of
        # motionEye cameras, otherwise remove the device (and thus entities).
        for device_entry in dr.async_entries_for_config_entry(
            device_registry, entry.entry_id
        ):
            for identifier in device_entry.identifiers:
                if identifier in inbound_camera:
                    break
            else:
                device_registry.async_remove_device(device_entry.id)

Alan just updated Alexa Media Player: Integration reload/HA restart is not deleting old devices · Issue #1281 · custom-components/alexa_media_player (github.com)

1 Like

I managed to remove a smartthings motion sensor from HA by deleting the device from Smartthings, then going into entities on HA and ticking all the boxes (3) that applied to that sensor. Then in the top right I had the options of exclude or delete from HA. I clicked delete and it worked fine.

I tried to take this issue with a tad of humor in a similar thread

That said

When you have deleted a device from Deconz you can run the service

deconz.remove_orphaned_entries

And then boot HA.

That should get rid of it

But there are still many integrations that leave garbage behind and it is still a major flaw in the generic HA UI that you cannot force a device deletion.

I find myself editing the .storage files at least once every 2nd month. There is always something that is broken that I can only remove this way.

Before anyone does this ALWAYS make backup of the files and watch out for the commas. Note that the last item in a list does not end with a comma in the json files. If you forget HA will not start. Any error in the JSON and HA will not start.

13 Likes

I’ve got a similar problem. Been playing around with ESPhome and using the same ESP do trial new setups. However because you can’t delete an old device, when you change it to a new one with different capabilities HA still see’s it as the old one. Even the name doesn’t change on the ESPhome integration.

Is there still no way to delete old/unused devices?

3 Likes

Same here… As i’m getting rid of devices connected via the Telldus integration, the ghosts of them are trapped in limbo in HA, unable to reach either heaven or hell.
Any way we can flag this as a bug or issue or something?

Btw, the Q/A you did was really funny :smiley:

Looks like the IKEA integration got updates as I no longer see old dead devices anymore! Woohoo!

1 Like

Been migrating from Smartthings and have moved all ZigBee devices and several Z-Wave devices.
Thes enot long show in the Smartthings App or at https://graph.api.smartthings.com/device/list but even after “reloading” the Smartthings integration the device never go away from home assistant.

Any ideas?

2 Likes

I hate to say it , as a moderate newbie. the oily way I found to delete/get rid of failed Z-wave devices was delete the whole VM and the associated VDI and start anew

I met this issue too. I ended up with large number of ghost items that I cannot delete. All I can do is disable them.

This is a mess. Not it just clutters everything but names are used by disabled entities so I cannot use them for new devices.

Is this really so big issue to allow option to delete device from the system?

1 Like

Damned, same problem here:

I’ve 2 esphome devices: they come with the same name out-of-the-box. So I’ve had trouble devising which one is which and renaming 1 of them using esptool/esphome.

Eventually I came to a point where I had 3 esphome devices in HA: 1 with the original name and 2 with the modified name.

So, I decided to delete 1 of the device with the modified name, found out I couldn’t delete it, went for disabling it. Then, HA told me something like “do you want to disable its configuration instead?”, I clicked OK.

Don’t know what happened exactly, but now, my HA setup has 2 esphome devices: the one with the original name functioning perfectly, and the one with the modified name which is disabled and which I can’t enable again (probably because I should enable its configuration instead of the device, but I can’t figure out yet how to do that…).

I don’t want to delete the whole integration since the original unmodified device works perfectly and I don’t want to lose its historical data.

What should I do?!?

You can remove them by going into your add-ons =>Z-Wave JS UI or Z-Wave JS
open web ui, then select your product and from action you can choose to remove failed nodes

You can re & re the ESPHome add-on without disrupting the integration setup as its data is stored in HA /config/esphome and remains behind and will reconnect. I had to do this to get the newest version of the ESPHome add-on.

As for buggered/duplicate devices, I’ve removed both the old & new devices from ESPHome integration and then restarted HA to trigger ESPHome re-discovery. I’ve also renamed yaml files as I wanted to change from " _ _ " style names to " - - ". As for historical data, I suspect that if the new device entity matches the history entity it will be there. Not sure though…

You disabled the device here?
image

Are you not able to delete it from there now that it’s disabled?

Dunno if you guys noticed it yet, but it seems you can delete a device from an integration in HA (I just tested with HACS SONOFF) by clicking on the hamburger in Device Info.

The following solution worked for me:

To delete old devices with the deconz dongle, do the following:

  1. Delete the device from the deconz “Connected sensors”-page.
    e.g.
    hassio route:
    /core_deconz

  2. Go to the Developer Tools > Services page
    e.g.
    hassio route:
    /developer-tools/service

  3. Call the following service
    Enter in the field: deCONZ: Remove orphaned entries
    Click on the button: Call Service

  4. Review the deconz devices under Settings and select the “X devices” link under the deCONZ Integration

The old devices are no longer listed.

This removed all the redundant devices e.g. died Aqara Temperature, Humidty, Air Preasure sensors I had that were sensed with my deCONZ dongle.

More Infos here:
SERVICE DECONZ.REMOVE_ORPHANED_ENTRIES

Remove entries from entity and device registry which are no longer provided by deCONZ.

Service Calls

3 Likes

I know this thread is a bit dated but this is how I got rid of them:

So I just went to the api page https://graph.api.smartthings.com/device/list :slight_smile:

  • Navigated on the left to MySmarthings

  • This took me to the Smarthings home page that shows all my devices

  • I removed all of the devices that were no longer valid

Went back to home assistant and removed the Smartthings integration - re-added back in and all my orphaned devices/entities were gone.

Yes, that seems to work but is still a workaround.
There must be a better way.
There is an issue, but some say that just the way it is.

This is a “negative customer impact feature”.