Bridging Frigate object detection into UniFi Protect
I run Frigate alongside UniFi Protect on my home NVR setup — six Reolink cameras, RTSP-fed into both. Protect handles recording; Frigate runs a proper OpenVINO object detector against the same streams for far more accurate person/vehicle detection than the cameras' onboard AI. The catch: Frigate's detections had no way to show up in Protect's own timeline, so I'd have to check two separate UIs to see what happened.
I wrote frigate-protect-bridge to fix that: a small daemon that subscribes to Frigate's MQTT event stream and injects each finished detection into UniFi Protect as a native smart-detect event with a thumbnail — clickable straight into the camera's existing recording.
The interesting part: MSR
The obvious approach — insert rows into Protect's events, smartDetectObjects, and thumbnails Postgres tables directly — mostly works, except thumbnails never load. Protect's /api/events/:id/thumbnail endpoint resolves images through a separate local service called MSR (Media Storage/Recording, a gRPC service on 127.0.0.1:7700) and never falls back to the raw thumbnails table for IDs it doesn't recognise as MSR-issued.
MSR's gRPC API isn't publicly documented. I reverse-engineered the StoreSnapshots RPC's wire format from strings embedded in /usr/bin/msr on the UDM itself, then confirmed the exact protobuf field layout by hand-building requests and probing the live service until one came back with a real thumbnail ID instead of an empty response. Full write-up of the schema is in the code comments.
What it does
- Runs on the UniFi console itself (tested on a UDM-SE), talking to Protect's local Postgres over the Unix socket — no database exposed on the network.
- Maps Frigate camera names to Protect cameras by IP.
- Coalesces rapid repeat detections and rate-limits per camera.
- Doesn't touch video — Protect keeps recording as normal, the bridge only adds event markers pointing into it.
Source, install script, and config example: github.com/Rob2dev/frigate-protect-bridge