I had two IP cameras briefly show up as “adoptable” in my UDR7, and the Unifi Protect integration for HA dutifully reported them and added them as devices.
I didn’t want to adopt these devices and removed them from my network. However, they refuse to go away in the Protect integration. I’ve tried deleting the devices, but they come back when the integration/hub is reloaded. The cameras don’t show up anywhere in my Unifi Console.
Is there a way to permanently delete them in the HA integration?
Not sure if you got this figured out, so I am going to drop this here in case anyone else has the same issue.
Unifi is terrible cleaning up old crap from the Database. So, when the Integration connects it sees things that are no longer there.
I know this works with a DMSE, It should work with others but not sure and no way to test.
I connected to the DMSE and ran ‘systemctl stop unifi-protect’ to shutdown protect. Then I used pgAdmin to connect to the protect database.
Create a new connection
General Tab > Name = Whatever you want
Connection Tab >
Host Name - localhost
Port = 5433
dbname and pass are default
SSH Tunnel Tab >
Tunnel Host = (IP of your device)
Username = root
You can save your password or prompt for it each time.
That should connect and you should see Databases Expand the one named Unifi Protect.
Then Expand Schemas > Public > Tables.
Select the table named cameras right click on it, and select View/Edit Data > All rows.
In the window on the right select the rows with the cameras to remove and click the delete button above the rows, and then click the ‘save data changes’ button.
You can now exit out of pgAdmin and run ‘systemctl start unifi-protect’
Go into HA and delete the integration reboot HA for good measure, and then re-add the integration, and the ghost devices should be gone.