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 catalog 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 holds a .idleSystemSleepDisabled activity assertion for the whole time Frigate is running, so the system stays awake on its own — MQTT publishes keep flowing without you needing to touch Energy Saver. See Mac sleep and Wake-On-Demand for the full story (including the lid-close caveat on laptops).