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_ID
variable 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.