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:
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.
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.
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.
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
download & install clicklick + change the path to this tool
change the ‘myUrl’ variable
change the ‘coordinate’ variables (done in full screen Safari)
you can uncomment “display dialogs” to check if the clicks are correct and when it works, increase batch_count