LW IT Solutions
« Blog Overview /CCTV/Tutorials / Intelligent Alarm Scenarios: Integrating Frigate AI Detection...

Intelligent Alarm Scenarios: Integrating Frigate AI Detection in Home Assistant

Part 3 of 4 in the series Video surveillance on your own hardware

Intelligent Alarm Scenarios: Integrating Frigate AI Detection in Home Assistant
Contents
  1. 1. Integration Architecture: MQTT Broker & Frigate Integration
  2. 2. Step-by-Step MQTT & HACS Setup
  3. 3. Production-Ready Home Assistant Alarm Automation
  4. 4. Step-by-Step Notification Optimization & False-Positive Suppression
  5. 5. Summary & Architectural Value
  6. Sources

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/events topic 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.
Cascade of five conditions filtering a Frigate MQTT event down to a real alarm, which then triggers floodlights, siren and a push notification
Every condition removes one class of false alarm before anything is triggered. Only an event that survives all five switches on the light, the siren and the notification.

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:

  1. MQTT Broker Verification: Ensure both Frigate NVR and Home Assistant are connected to the same Mosquitto MQTT broker instance. Verify that Frigate’s mqtt.host configuration points to the broker IP.
  2. Install Frigate via HACS: Open HACS in Home Assistant, search for Frigate under Integrations, download the repository, and restart Home Assistant Core.
  3. 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'] == 'end' }}"
  - 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:

  1. Confidence Score Thresholding: Require a minimum top_score of 0.80 (80% probability) within the automation conditions to filter out ambiguous reflections or edge cases.
  2. Zone Transition Validation: Configure conditions using entered_zones rather than global motion to restrict active alarms exclusively to secure property boundaries.
  3. Notification Throttling: Set the automation execution mode to single with 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.

Video surveillance on your own hardware

  1. AI-Powered Edge Video Surveillance: Frigate NVR with Google Coral TPU
  2. Storage and Bandwidth Engineering for Enterprise CCTV Networks
  3. Intelligent Alarm Scenarios: Integrating Frigate AI Detection in Home Assistant
  4. CCTV Cabling: PoE Compared With Coax for Security Installations
Lukas Wojcik

Lukas Wojcik

Systems architect and technology enthusiast specializing in scalable tracking solutions, GMP Stack (GA4 & GTM), and robust backend architectures. Advocate for clean code and privacy-first design.

Get in Touch

Briefly describe your project or inquiry for a tailored response. This site is protected by reCAPTCHA.

Write a comment

The email address is not published. Required fields are marked with an asterisk.

ALL ARTICLES & CATEGORIES

CCTV

Follow this category by RSS

Cloud & AI

Follow this category by RSS

Data Privacy

All 13 articles in this category Follow this category by RSS

Digital Analytics

All 51 articles in this category Follow this category by RSS

Digital Marketing

All 30 articles in this category Follow this category by RSS

IT & Networks

All 17 articles in this category Follow this category by RSS

Music Production

Follow this category by RSS

Raspberry PI

Follow this category by RSS

Smart Home

All 19 articles in this category Follow this category by RSS

Web Development

Follow this category by RSS

WordPress Plugins & Tricks

Follow this category by RSS