Intelligent Alarm Scenarios: Integrating Frigate AI Detection in Home Assistant
Part 2 of 2 in the series Video surveillance on your own hardware

Contents
Integrating Frigate NVR with Home Assistant transforms passive video surveillance into an active, intelligent perimeter defense platform. Traditional motion-triggered automation engines generate constant false alerts caused by moving shadows or passing animals, rendering automated sirens and floodlights useless. By leveraging real-time MQTT object detection states and high-confidence AI bounding-box tracking from Frigate, Home Assistant can trigger precise deterrent actions—such as instant push notifications with annotated snapshots, floodlight activation, or siren warnings—exclusively when unauthorized human intruders cross designated security zones.
1. Integration Architecture: MQTT Broker & Frigate Integration
The communication bridge between Frigate NVR and Home Assistant relies on asynchronous MQTT messages and custom Home Assistant Integration components:
- MQTT Event Stream: Frigate publishes real-time JSON payloads to the
frigate/eventstopic whenever an object is detected, tracked, or updated across defined camera zones. - Frigate Home Assistant Integration: Installed via HACS (Home Assistant Community Store), this integration automatically creates binary sensors, camera entities, and media browser feeds inside Home Assistant.
- Media Cache API Endpoint: High-resolution snapshots and video clips generated during detection events are exposed locally via secure API endpoints (e.g.,
/api/frigate/notifications/{event_id}/snapshot.jpg), allowing instant embedding into mobile alerts.
2. Step-by-Step MQTT & HACS Setup
To establish the event telemetry pipeline, the custom integration must be authenticated and connected to the shared MQTT broker:
- MQTT Broker Verification: Ensure both Frigate NVR and Home Assistant are connected to the same Mosquitto MQTT broker instance. Verify that Frigate’s
mqtt.hostconfiguration points to the broker IP. - Install Frigate via HACS: Open HACS in Home Assistant, search for Frigate under Integrations, download the repository, and restart Home Assistant Core.
- Add Integration Entry: Navigate to Settings > Devices & Services > Add Integration, select Frigate, and enter the local HTTP URL of the Frigate NVR instance (e.g.,
http://192.168.10.20:5000).
3. Production-Ready Home Assistant Alarm Automation
The following Home Assistant automation YAML script listens to Frigate MQTT event payloads, verifies zone boundaries, turns on floodlights, triggers a high-priority mobile alert with a snapshot image, and sounds an alarm siren when an intruder enters a restricted area at night:
alias: "Security: Intruder Detection Driveway Zone"
description: "Triggers floodlights, sirens, and actionable notifications with snapshots when a person is detected."
trigger:
- platform: mqtt
topic: frigate/events
condition:
- condition: template
value_template: "{{ trigger.payload_json['type'] == 'new' or (trigger.payload_json['type'] == 'update' and 'driveway_private' not in trigger.payload_json['before']['entered_zones']) }}"
- condition: template
value_template: "{{ trigger.payload_json['after']['label'] == 'person' }}"
- condition: template
value_template: "{{ 'driveway_private' in trigger.payload_json['after']['entered_zones'] }}"
- condition: template
value_template: "{{ trigger.payload_json['after']['top_score'] >= 0.80 }}"
- condition: time
after: "22:00:00"
before: "06:00:00"
action:
# 1. Turn on perimeter floodlights
- service: light.turn_on
target:
entity_id: light.driveway_floodlights
data:
brightness_pct: 100
# 2. Sound alarm siren for 15 seconds
- service: siren.turn_on
target:
entity_id: siren.outdoor_siren
data:
duration: 15
# 3. Send actionable mobile notification with high-res snapshot
- service: notify.notify
data:
title: "🚨 INTRUDER DETECTED"
message: "An unauthorized person was detected in the private driveway zone."
data:
image: "/api/frigate/notifications/{{ trigger.payload_json['after']['id'] }}/snapshot.jpg"
tag: "intruder_driveway"
priority: high
ttl: 0
clickAction: "/api/frigate/notifications/{{ trigger.payload_json['after']['id'] }}/clip.mp4"
mode: single
4. Step-by-Step Notification Optimization & False-Positive Suppression
To maintain absolute system reliability and prevent notification fatigue, granular filtering parameters must be enforced:
- Confidence Score Thresholding: Require a minimum
top_scoreof0.80(80% probability) within the automation conditions to filter out ambiguous reflections or edge cases. - Zone Transition Validation: Configure conditions using
entered_zonesrather than global motion to restrict active alarms exclusively to secure property boundaries. - Notification Throttling: Set the automation execution mode to
singlewith a delay buffer or rate limiter to prevent duplicate notifications during prolonged presence.
5. Summary & Architectural Value
What this tutorial achieves: The successful integration of Frigate NVR AI object detection with Home Assistant via MQTT and HACS, creating an automated, high-precision perimeter security response system.
Resulting value: Nuisance alerts caused by rain, shadows, or animals are completely eliminated. Active deterrents—such as floodlights, audio sirens, and actionable push notifications containing high-resolution snapshots and clip links—trigger exclusively upon verified human intrusion, delivering immediate situational awareness and robust perimeter protection without cloud subscription costs.
Questions and answers
Does the alerting still work when the internet connection is down?
For the most part. Detection in Frigate, the MQTT broker, the automation in Home Assistant, floodlight and siren all run on the local network and need no outside connection. The push notification to the phone is different: it does not travel directly from the server to the device but normally goes through Apple’s or Google’s notification services, so without an internet connection it does not reach a phone that is away from home. Only on the home Wi-Fi can the Companion app, depending on its settings, receive notifications directly from Home Assistant.
A second dependency sits in the image. The automation does not send a snapshot but a path, /api/frigate/notifications/…/snapshot.jpg; the phone fetches the image from Home Assistant only when the notification is displayed. Away from home this only works if Home Assistant is reachable from outside; otherwise the notification appears without an image and the clip cannot be opened.
An alarm that has to reach someone even when the line is down therefore needs a path that does not run over the same line, such as a mobile connection as a backup on the router. The siren on site is independent of all this.
Why does mode: single on its own not prevent duplicate notifications?
Because single only blocks a second run while the first is still in progress, and that run ends almost immediately after light, siren and notification: the siren’s 15 seconds are counted by the device, not by the automation. Only a final delay action, lasting a few minutes for instance, keeps the run open so that further triggers during that time are dropped. The notification’s tag parameter additionally ensures that a new notification on the phone replaces the older one with the same value instead of appearing next to it.
Video surveillance on your own hardware
- Storage and Bandwidth Engineering for Enterprise CCTV Networks
- Intelligent Alarm Scenarios: Integrating Frigate AI Detection in Home Assistant