How to delete devices

I’d like to have is as well, please!

Spot on - exactly what was needed - thanks. Devolo integration had left a ghost device sitting around (probably as it got renamed and generally reconfigured a lot and left things in a confused state) - quick edit of core.device_registry to remove the offending device entry worked a treat.

Is your script to delete unused entities still working? (There has been several updates to core since you wrote it).

As far as I know it still works, I haven’t used it in a couple of months.

At least one person had sent me changes to make it a bit friendlier, but I haven’t put them in.

Hi @bretton.wade
I encountered a problem and asked for help here:

https://community.home-assistant.io/t/homematic-cannot-delete-obsolate-devices-and-entities-failure-of-delete-cache-service/623688

And I found your post here with the linked GitHub.
Unfortunately, I couldn’t find any information/explanations about your GitHub…
How does it work?
How do I use it?
Does it first check and list found obsolate devices, and can I choose devices I want to delete, or is it full automatic without control?
Can this solve my problem?
Many thanks

I’m sorry for the delay in responding… The script I shared might work for your use-case, but it is not user-friendly at all. It simply automated the steps of finding all the relevant configurations in the various configuration files (core.config_entries, core.entity_registry, and core.device_registry) when removing a stale entity.

If you are able to run a python script, you can try copying these configuration files to a separate directory and experiment with the script. If you are technical, I welcome a PR with updates.

If you don’t want to experiment with the script, the “Hidden by integration” problem can be solved with an editor by searching the core.entity_registry file for the tag, “hidden_by”: and setting that to “null”:

        "entity_id": "binary_sensor.updater",
        "hidden_by": null,
        "icon": null,

After that, reboot HA, and then you might be able to delete the entity from within HA (no promises, though).