After running rtl_433 with the MQTT Discovery add-on for a while, I ended up with hundreds of my neighbors devices in my Home Assistant instance. This was when I found out there was no easy way to delete them and was faced with the prospect of going to each one in the GUI, picking "delete" from a menu and the confirming it hundreds of times.
I'm too lazy for that, so I did this instead, based on some code from the forums I came up with this.
To use this:
- Create a new Area in your Home Assistant (I called mine "Garbage"), and change the
GARBAGE_IDvariable in the code to have the ID of your new area. - In the devices list you can hit the "select" button and put checkmarks next to all the devices you want to get rid of. Then use the menu in the upper right to mass move all those devices into the "Garbage" area.
- Open your browser's JavaScript console and paste in the code below. It will delete all the devices in that garbage area.

I had 1400+ of my neighbors RFXCOM devices cluttering my setup for years. Can't believe it's not an option to bulk delete devices in Home Assistant. This is awesome, thanks!
The script worked fine except it could not delete some 15 devices that gave me errors in the java script console;
... VM387:21 Failed to delete device cdac56ad6edf72a4ac10ff12c5f04b48: {code: 'invalid_format', message: "expected str for dictionary value @ data['config_entry_id']. Got None"}code: "invalid_format"message: "expected str for dictionary value @ data['config_entry_id']. Got None"[[Prototype]]: Object (anonymous) @ VM387:21 await in (anonymous) (anonymous) @ VM387:24 VM387:21 Failed to delete device e9023c62c0b1a46f967167d5e8689af0: {code: 'invalid_format', message: "expected str for dictionary value @ data['config_entry_id']. Got None"} (anonymous) @ VM387:21 await in (anonymous) ...