UniFi - Login with SSH (Advanced) https://help.ui.com/hc/en-us/articles/204909374-UniFi-Login-with-SSH-Advanced-

Run the mongo database util and change xx:xx:xx:xx:xx:xx to the mac address of your rogue device
mongo --port 27117 ace --eval 'db.device.remove({"mac":"xx:xx:xx:xx:xx:xx"})'


Restart your UniFi controller e.g. if running on a CloudKey (Linux). Use 'sudo' command if not logged in as root.

systemctl restart unifi