Can't remove 100's of RFXTRX devices - delete grayed out

I left discovery on too long (like, months) and have literally hundreds of rfxtrx devices which aren’t mine and I don’t want. If I try to remove a device, the delete button is grayed out:

If I try to remove the same device from the entities list, I get this:

Please help! How can I destroy these unnecessary devices? I think it’s breaking the google assistant integration because so many devices are in the list.

Thanks in advance!

Hi, sorry for this late answer.
You can delete the device from the integration options.

Ah sweet, I missed that! Thank you! Annoying to do in bulk, but at least there is a way.

Just FYI: the delete option is now gone. I wrote a (dangerous) python script that deletes large number of items from the core.device_registry and core.entity_registry files.
This to prevent having to remove >1,700 devices manually (5 clicks each).
Let me know if you want the script.

1 Like

Hi, I have this exact need right now since I left the automatic add on for too long and the option to select multiple and delete seems gone. I too have like a thousand devices and I started deleting them in the UI but gave up pretty soon. Please paste or link to your script so that I dont need to write my own.

Thanks!

1 Like

Tobias,

Sorry for the delay. I had to re-prioritize my ‘home automation’ time to help out friends.
Here’s the script:

# DJ: Script to remove 1700 devices from HomeAssistant
# batch_count = batch size. Start small, then increase. At the end I used batches of 250
set batch_count to 1
set myDelay to 0.5
# myUrl = Is the browser still is on the right page? (security)
set myUrl to "http://your_hs_ip:8123/config/devices/dashboard"
# COORDINATE: select device
set item_sel to "780,485"
# COORDINATE: delete button
set item_del to "600,400"
# COORDINATE: click OK
set item_ok to "1060,680"
# COORDINATE: click back
set item_bk to "300,114"
# path to clicklick 5.0.1 (https://github.com/BlueM/cliclick)
set cc_path to "/Users/your_username/path_to_clicklick/"

repeat batch_count times
	activate application "Safari"
	delay myDelay
	
	tell application "Safari"
		set theURL to URL of current tab of window 1
	end tell
	if theURL is not myUrl then
		display dialog "ERROR STOP! URL: " & theURL
		return "ERROR, STOP!"
	end if
	
	delay myDelay / 2
	
	do shell script cc_path & "cliclick c:" & item_sel
	# display dialog "test-click1-select"
	
	delay myDelay
	do shell script cc_path & "cliclick c:" & item_del
	# display dialog "test-click2-delete"
	
	delay myDelay
	do shell script cc_path & "cliclick c:" & item_ok
	# display dialog "test-click3-ok-confirm"

	delay myDelay
	do shell script cc_path & "cliclick c:" & item_bk
    # display dialog "test-click4-back"
	
	delay 0.5
	
	# display dialog "Ready for next?" & theURL
end repeat
  1. download & install clicklick + change the path to this tool
  2. change the ‘myUrl’ variable
  3. change the ‘coordinate’ variables (done in full screen Safari)
  4. you can uncomment “display dialogs” to check if the clicks are correct and when it works, increase batch_count

Hope it can still help you (or others)

Cheers!
DJ

2 Likes