Zum Hauptinhalt springen

Frigate Smart-Home-Integration, kostenlos und Open Source

Frigate-Integration für Gladys Assistant

Frigate NVR cameras: snapshots, motion, objects, reviews and scene triggers.

Info

Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.

Bring the cameras of your Frigate NVR into Gladys Assistant: snapshots, motion, detected objects, review alerts, camera switches, and scene triggers to react when a person, a car or an animal shows up.

Requirements​

  • Gladys Assistant 5.1 or later.
  • Frigate 0.16, 0.17 or 0.18. The integration reads the Frigate version and configuration and only exposes what your Frigate actually enables.
  • Recommended: the MQTT broker Frigate publishes to. Without a broker, the integration falls back to the Frigate WebSocket.

Quick start​

  1. In Frigate, create a dedicated account: Settings → Users → Add user, role viewer (enough when an MQTT broker is used, see below).
  2. In Gladys, install Frigate from the integration store, then open its Configuration tab: Frigate URL https://<frigate-ip>:8971, the account, and the MQTT broker Frigate publishes to. Save.
  3. The status at the top says "Connected to Frigate …, Real-time feed: MQTT broker connected". Test the connection gives the details.
  4. In the Discover tab, press Add to Gladys on your cameras.
  5. Create scenes with the Frigate triggers (see Scenes).

Frigate connection​

FieldWhat to enter
Frigate URLhttps://<frigate-ip>:8971 (authenticated port, recommended). Port 5000 works but has no authentication at all: a warning is shown in the connection status.
Username / passwordA dedicated Frigate account. The viewer role (or a custom role limited to your cameras) is enough: camera commands go through MQTT, not through the Frigate API.

Certificate: trusted on first connection​

Frigate's port 8971 serves a self-signed certificate by default. You do not have to do anything:

  • a certificate signed by an authority (Let's Encrypt, your company CA installed in the system…) is verified normally, and renewals keep working, as long as the Frigate URL uses a name the certificate covers (reached by its IP address instead, it is handled like a self-signed one, and each renewal asks you to trust it again);
  • a self-signed certificate is trusted on the first connection, then pinned: if it changes later (Frigate reinstalled, certificate regenerated… or someone impersonating Frigate), the connection is refused and the status explains why.

When you know the certificate changed for a legitimate reason, press Trust the new certificate in the Configuration tab: the next connection trusts and pins the new certificate. The same applies to the MQTT broker when TLS is enabled.

The first connection is the only moment the certificate is not checked: run it on your local network, not through an untrusted network.

Expert settings (optional)​

At the bottom of the Configuration tab, fill in one of these fields to replace the trust on first use:

  • Pinned certificate SHA-256 fingerprint: only this exact certificate is accepted. To read it, from the Frigate host itself or a trusted machine:

    openssl s_client -connect <frigate-ip>:8971 </dev/null 2>/dev/null \
    | openssl x509 -noout -fingerprint -sha256
  • Certificate authority (PEM): your own authority; the certificate must be signed by it and match the host name.

Real-time feed (MQTT)​

Enter the broker host, port, credentials and the Frigate topic prefix (frigate by default). Give the integration its own broker account with this ACL (Mosquitto syntax):

user gladys-frigate
topic read frigate/#
topic write frigate/+/+/set

Leave the broker host empty to use the Frigate WebSocket instead. Camera commands (the switches) then need an admin Frigate account: since Frigate 0.17, the WebSocket refuses them from other roles.

The connection status shows the state of the feed ("Real-time feed: MQTT broker connected", or why not). A network failure is retried on its own; a refused certificate or account stops the feed until you fix it and press Test the connection (or save the configuration). When Frigate announces it is offline (restart), the status says so, and its configuration is read again when it comes back.

Each incident is also written to the integration logs (View logs): front: person detected, 87 %, front: person entered porch, 87 %, front: review alert, person, car in porch.

Cameras in Gladys​

Open the Discover tab of the integration: every Frigate camera is listed (press Scan to read Frigate again). Press Add to Gladys on the ones you want. Each camera device carries what its Frigate configuration enables:

FeatureWhat it does
ImageRefreshed every minute, taken fresh when Gladys asks (chat, scenes). Frigate resizes it to fit the 150 KB Gladys accepts.
Camera enabledTurns the camera on or off in Frigate (no detection, no recording while off); Gladys then shows no image of it either.
Object detection, SnapshotsFrigate's switches.
Recordings, Audio detectionOnly when enabled in the Frigate configuration file: Frigate refuses to turn them on otherwise.
MotionMotion seen by Frigate.
One sensor per tracked object (Person…)Present / absent, and its count. Plus the total of objects.
Review statusnone, detection or alert.
Zone sensorsWith the "Zone occupancy sensors" option: one presence sensor per zone and object.

A switch is only shown as changed once Frigate confirms it. Without an MQTT broker, the Frigate WebSocket only accepts commands from an admin account (Frigate 0.17 and later): with another role, the command fails with that explanation.

The badge of each camera says when it is not nominal: unreachable when Frigate does not answer, announces it is offline, or the camera stream has been lost for 30 seconds; degraded when its recording stream is interrupted or the real-time feed is down (the states may then be outdated).

A camera added with an older version of the integration shows Update in the Discover tab: press it to add the new features.

Scenes​

Three triggers, fired once per incident (never once per frame), above the minimum confidence and outside the cooldown (see Options). False positives and objects standing still never fire.

TriggerFires whenFilters
Frigate: new reviewFrigate opens a review item (alert or detection); once more when a detection becomes an alertcamera, severity, object, zone
Frigate: object detectedFrigate starts tracking an object (person, car…)camera, object, zone
Frigate: object enters a zoneA tracked object enters a zone defined in Frigatecamera, zone, object

Object and zone are the names used in Frigate, in lowercase (person, car, dog, cat, bicycle… for objects, those of objects.track; porch… for zones); an empty field accepts any value. The objects a camera tracks are also its presence sensors (Person, Car…). "Object detected" only fires on an object confirmed by Frigate's detection, above the minimum confidence: plain motion never fires it (motion is the camera's "Motion" sensor). A review is filtered on its main object (the first of the camera's tracked objects, in the order of the Frigate configuration) and its first zone; all of them are in the objects and zones variables. Variables available in the following actions: camera, camera_name, label, sub_label (face or plate recognized by Frigate), zone, zones, score (%), severity, objects, event_id, review_id.

On an alert, the integration pushes a fresh image of the camera before firing the trigger: the core action "Send a camera image" placed right after it sends the alert.

Action "Frigate: attach the event snapshot": publishes the snapshot Frigate kept for an event (with or without its bounding box) as the image of the camera (the event's camera by default). Use {{triggerEvent.data.event_id}} as the event id, then "Send a camera image". For one minute, the snapshot is also what Gladys gets when it asks for a live image of that camera ("Send a camera image", the dashboard live view). When Frigate keeps no snapshot for the camera, or keeps one too large for Gladys, its thumbnail is used. Once the event is over, Frigate serves the snapshot it saved: the bounding box then follows its own snapshots.bounding_box setting.

Example — a photo on your phone when someone comes to the door:

  1. Trigger Frigate: new review, camera Front door, severity Alert, object person.
  2. Action Frigate: attach the event snapshot, event id {{triggerEvent.data.event_id}}.
  3. Action Send a camera image of Front door to yourself.

Options​

  • Minimum confidence (default 70 %): object triggers only fire above it (reviews carry no score: Frigate's own thresholds apply).
  • Trigger cooldown (default 30 s): at most one trigger per camera and object type (and zone, for zone triggers; per camera and severity for reviews) and period, so an incident never floods your scenes. False positives and objects that stay still (a parked car) never trigger.
  • Zone occupancy sensors (off by default): one presence sensor per zone and tracked object.

Live video​

Live video is not carried by this integration. Use the built-in RTSP camera service of Gladys pointed at the Frigate go2rtc restream: rtsp://<frigate-ip>:8554/<camera_name>.

Configuration buttons​

  • Test the connection: Frigate's version and cameras, how its certificate is trusted, the account used, and a connection to the MQTT broker (or a reminder that the Frigate WebSocket is used without one).
  • Refresh the cameras: reads the Frigate configuration again (for instance after adding a camera) and updates the list of the Discover tab.
  • Trust the new certificate: forgets the pinned certificates of Frigate and of the broker, reconnects, and shows the fingerprint now pinned. Compare it with the one of your Frigate (command above) when in doubt.

When Frigate cannot be reached, the integration tries again every minute. A refused certificate or refused credentials wait for you instead: retrying would only lock the account out (Frigate limits failed logins).

Security​

  • The integration only talks to Frigate and to the broker, on your network; it runs in an isolated container (read-only, no privileges, its only writable folder holds the pinned certificates).
  • A dedicated Frigate account with the viewer role (or a role limited to some cameras) cannot change Frigate's configuration. With MQTT, the broker account above can only read Frigate's topics and send the camera commands.
  • Certificates: verified by an authority, or pinned on first use (see above); the Frigate token and the broker password are only sent once the certificate is trusted.
  • Passwords, tokens and cookies never appear in the logs or the status.
  • Port 5000 and MQTT without TLS work, with a warning in the status: use them only on a network you trust.

Troubleshooting​

The connection status at the top of the Configuration tab says what is wrong; Test the connection checks everything again. The integration logs (supervision controls, View logs) never contain passwords or tokens.

SymptomWhat to check
"The certificate of … changed"Frigate reinstalled or certificate regenerated: press Trust the new certificate. Otherwise, someone may be impersonating Frigate.
"Frigate refused the username or the password"The account of the Configuration tab. After several failures Frigate blocks logins for a while: the integration does not retry by itself.
The Discover tab is emptyThe status: Frigate must be reachable. Then Scan.
No image on the dashboardThe camera is on in Frigate and in Gladys; wait one minute after adding it.
A switch fails ("did not confirm", "admin account")Without a broker, Frigate 0.17+ only accepts commands from an admin account; with a broker, its ACL must allow frigate/+/+/set.
"Real-time feed stopped"The broker refused the account or the certificate: fix it, then Test the connection.
Camera badge "unreachable"Frigate is down or restarting, or the camera stream has been lost for 30 s (check the camera in Frigate).
A scene does not fireThe minimum confidence and the cooldown (Options); the object and zone names are Frigate's (person, not Person); the logs show each incident.
A camera added before an update misses featuresThe Discover tab shows Update on it.

Konfigurationseinstellungen​

Diese Einstellungen fragt Frigate in seinem Konfigurationsbildschirm in Gladys ab.

EinstellungTypPflichtfeldBeschreibung
Frigate serversectionNeinFrigate 0.16 or later. Use the authenticated port (https://<ip>:8971) with a dedicated Frigate account; the viewer role is enough, camera commands go through MQTT. Frigate's self-signed certificate is trusted on first connection, then pinned. Port 5000 has no authentication at all.
Frigate URLstringJa
Frigate usernamestringNein
Frigate passwordsecretNein
Real-time feedsectionNeinEnter the MQTT broker Frigate publishes to (recommended). Leave the host empty to use the Frigate WebSocket instead, without a broker. The broker account needs read access to <prefix>/# and write access to <prefix>/+/+/set.
MQTT broker hoststringNein
MQTT broker portnumberNein
MQTT usernamestringNein
MQTT passwordsecretNein
MQTT over TLSbooleanNeinThe broker certificate is checked like Frigate's: trusted if signed by an authority, otherwise trusted on first connection and pinned.
Frigate topic prefixstringNein
OptionssectionNeinScene triggers only fire above the minimum confidence, and at most once per camera and cooldown period.
Minimum confidence (%)numberNein
Trigger cooldown (s)numberNein
Zone occupancy sensorsbooleanNeinAdds one presence sensor per zone and tracked object.
Expert: TLS certificatesectionNeinOptional. By default, a certificate signed by an authority is verified normally, and a self-signed one is trusted on the first connection, then pinned: if it changes later, the connection is refused until you press "Trust the new certificate". Fill in ONE of the fields below to pin a known certificate or use your own authority instead.
Pinned certificate SHA-256 fingerprintstringNein
Certificate authority (PEM)stringNeinPaste the PEM certificate of your authority; a single line is fine.

So installierst du Frigate in Gladys​

  1. Öffne in Gladys Integrationen: Frigate erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
  2. Klicke auf Installieren. Gladys lädt das Docker-Image (ghcr.io/lm1lc3n7/gladys-frigate:0.3.1) herunter, startet es in einer vom Kern isolierten Sandbox und erzeugt die Oberfläche der Integration (Geräte, Erkennung und Konfiguration).
  3. Öffne den Bildschirm Konfiguration der Integration, fülle die Einstellungen aus und speichere.
  4. Du kannst sie auch direkt über die URL ihres Repositorys installieren: https://github.com/LM1LC3N7/gladys-frigate.

Frigate benötigt Gladys >=5.1.0. Der Katalog in Gladys wird stündlich aktualisiert, eine neue Version ist also spätestens eine Stunde nach ihrer Veröffentlichung verfügbar.

Du nutzt Gladys noch nicht? Es ist kostenlos und Open Source: folge der Installationsanleitung, um loszulegen.

Über externe Integrationen​

Frigate ist eine externe Integration: eine Community-Integration, die als Docker-Container verpackt und auf GitHub veröffentlicht wird. Gladys installiert sie mit einem Klick und führt sie in einer vom Kern isolierten Sandbox aus. Sie wird von LM1LC3N7 veröffentlicht und gepflegt, nicht vom Gladys-Kernteam.

Abonniere den Newsletter von Gladys Assistant

Ein paar E-Mails im Monat zu neuen Releases und Neuigkeiten aus dem Projekt. Verschickt von Pierre-Gilles Leymarie, dem Gründer des Projekts. Jederzeit abbestellbar 🙂