Skip to content

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.

When something happens on a camera, Fregata emits:

  1. An MQTT message on a per-camera, per-class topic.
  2. A new row in the SQLite events table.
  3. (If snapshots.enabled: true) a JPEG to ~/Fregata/media/clips/<camera>-<event-id>.jpg.
  4. (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.

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: 60

Fregata 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:

TopicPayloadWhen
frigate/eventsJSON event objectNew event, in-progress update, end
frigate/<camera>/<class>ON / OFFClass enters or leaves the frame
frigate/<camera>/<class>/snapshotJPEG bytesNew event snapshot
frigate/<camera>/motionON / OFFMotion start / stop
frigate/statsJSON system statsEvery stats_interval seconds

For the full topic catalogue see the Frigate MQTT reference.

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 bash
mosquitto_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/fregata
done

Run 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.

The two cleanest paths:

  1. Through Home Assistant. The HA mobile app supports rich push with images via notify.mobile_app_*. The Home Assistant guide shows the automation template.
  2. 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.

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.