Skip to content

UniFi Protect

FreeSDN includes a UniFi Protect adapter in the cameras module that connects to the UniFi Protect API served by UniFi OS consoles (UDM, UDM-Pro, UniFi NVR, Cloud Key Gen2+).

FeatureNotes
Camera discoveryList cameras registered to a Protect console
Live streamRTSP URL retrieval from the Protect API
SnapshotJPEG snapshot via Protect API
Camera detailModel, firmware, resolution, recording mode
Device infoConsole model, firmware, storage status
  • PTZ control - Protect API PTZ support is undocumented; commands are not exposed. Note: the adapter manifest currently declares Capability.CAMERA_PTZ for G3/G4/G5-PTZ models and discover_devices() appends Capability.PTZ for any camera whose Protect bootstrap reports featureFlags.hasPanTilt, but no PTZ methods are implemented in the adapter - any PTZ API call will return a NOT_SUPPORTED error at runtime. Treat these capability declarations as inaccurate for runtime behavior; PTZ API calls return a NOT_SUPPORTED error.
  • Recording playback - searching and downloading recorded clips through FreeSDN is not implemented for Protect.
  • Event ingest - motion, smart detection (person, vehicle, package) events from Protect are not ingested into the FreeSDN event bus.
  • Doorbells / smart sensors - only standard IP cameras are managed.
  • No frontend page yet - operators consume the REST endpoints directly; no dedicated Protect UI page exists.

Authentication uses a UniFi local account with the Protect role on the console.

Terminal window
# Add the Protect console as a controller
curl -X POST https://freesdn.example.com/api/v1/controllers \
-H "Cookie: freesdn_access=<token>" \
-H "X-CSRF-Token: <csrf>" \
-H "Content-Type: application/json" \
-d '{
"name": "UDM-Pro Protect",
"controller_type": "unifi",
"host": "10.0.0.1",
"port": 443,
"use_ssl": true,
"verify_ssl": false,
"site_id": "<site-uuid>",
"username": "freesdn",
"password": "s3cr3t"
}'
# Trigger discovery
curl -X POST https://freesdn.example.com/api/v1/discovery/controllers/<controller-uuid> \
-H "Cookie: freesdn_access=<token>" \
-H "X-CSRF-Token: <csrf>"

Discovered cameras appear in Video Surveillance → Cameras with vendor: Ubiquiti.

UniFi OS consoles authenticate through /api/auth/login (POST with username / password). The adapter stores the session cookie and re-authenticates on expiry. Two-factor authentication on the local account will cause login failures - use an account without 2FA or a local-only account.

UniFi Protect cameras use the cameras module routes at /api/v1/cameras/. The adapter is selected when the camera or controller record has vendor set to "unifi_protect", "unifi", or "ubiquiti" (all three map to this adapter). Note that "unifi" and "ubiquiti" are also assigned by the network scanner and auto-discovery for Ubiquiti hardware; these records will use the Protect adapter for camera operations regardless.

File a GitHub Issue tagged adapter:unifi-protect to report field behavior.

All product names, logos, and brands are property of their respective owners. FreeSDN is an independent project and is not affiliated with or endorsed by the vendors it integrates with. See Trademarks.