MQTT, webhooks, notifications
Fregata uses upstream Frigate’s notification model unchanged. The short version: MQTT for live state, the HTTP API for snapshots and clips, webhooks if you want a synchronous out-of-band push. This page covers the macOS-specific bits and points at the Frigate docs for the rest.
The data plane
Section titled “The data plane”When something happens on a camera, Fregata emits:
- An MQTT message on a per-camera, per-class topic.
- A new row in the SQLite events table.
- (If
snapshots.enabled: true) a JPEG to~/Fregata/media/clips/<camera>-<event-id>.jpg. - (If
record.enabled: true) the event clip to~/Fregata/media/clips/<camera>-<event-id>.mp4, once the event ends.
The HTTP API at http://localhost:8971/api/... exposes all of those
to the rest of your stack — see
the Frigate HTTP API reference.
MQTT setup
Section titled “MQTT setup”The minimal config block in ~/Fregata/config/config.yml:
mqtt: enabled: true host: 10.0.1.42 port: 1883 user: fregata password: !env_var FREGATA_MQTT_PASSWORD topic_prefix: frigate client_id: fregata stats_interval: 60Fregata sets topic_prefix: frigate by default for compatibility
with existing dashboards and the HA integration. Override it if you
want — but if you do, remember to set the same topic_prefix in
the HA integration config.
The topics you’ll typically care about:
| Topic | Payload | When |
|---|---|---|
frigate/events | JSON event object | New event, in-progress update, end |
frigate/<camera>/<class> | ON / OFF | Class enters or leaves the frame |
frigate/<camera>/<class>/snapshot | JPEG bytes | New event snapshot |
frigate/<camera>/motion | ON / OFF | Motion start / stop |
frigate/stats | JSON system stats | Every stats_interval seconds |
For the full topic catalogue see the Frigate MQTT reference.
Webhooks (a common pattern, not built-in)
Section titled “Webhooks (a common pattern, not built-in)”Fregata doesn’t ship a “webhooks” config block per se — the cleanest
way to get HTTP push notifications is to subscribe to MQTT events
from a tiny external script. A 30-line shell + mosquitto_sub
script is plenty:
#!/usr/bin/env bashmosquitto_sub -h 10.0.1.42 -t 'frigate/events' | while read -r line; do curl -X POST -H 'Content-Type: application/json' \ -d "$line" \ https://hooks.example.com/fregatadoneRun that from a launchctl-managed agent on the same Mac (or a
different machine) and you’ve got a webhook bridge. If this becomes
an ongoing project, you’ll probably outgrow shell — but it’s a fine
starting point.
Push notifications to your phone
Section titled “Push notifications to your phone”The two cleanest paths:
- Through Home Assistant. The HA mobile app supports rich push
with images via
notify.mobile_app_*. The Home Assistant guide shows the automation template. - Directly via Pushover, Telegram, or ntfy. Same MQTT-bridge
pattern as above. The notification body can include the snapshot
URL (
/api/events/<id>/snapshot.jpg) so phones render the image inline.
There’s no first-party Fregata mobile app and no plans for one. The NVR is the boring, well-understood part; the phone delivery is best left to whichever of the dozens of solid push services you already use.
A note on macOS power management
Section titled “A note on macOS power management”Fregata is a regular foreground app. If your Mac sleeps, MQTT publishing stops because the Python process is paused. Two options:
- Keep it awake. A Mac mini dedicated to Fregata should have Energy Saver set to “Prevent automatic sleeping when the display is off” and “Wake for network access” — the relevant settings are in System Settings → Energy Saver (or Battery on laptops).
- Live with it. A laptop that sleeps when its lid closes is going to miss events. That’s not a Fregata behaviour, it’s the OS. If you need 24/7 detection, run on a desktop Mac.