Very simple python script to remove dead devices and entities from Home Assistant
Use at your own risk!
Steps:
- Rename devices to add " dead" in the name at the end
- Put the script in the HA home directory (where the .storage directory is located)
- Stop HA (depends on how you run it)
- Run using python (you may need sudo)
- The script will create two .bak files and two .upd files. The script operates on core.device_registry and core.entity_registry files. Files are not modified by the script, instead .upd files are created
- You may use diff to see the difference
- Copy .upd files to replace original files
- Start HA