Frigate: AI-Powered Security System (Horus)

Frigate serves as the computer vision and security monitoring foundation of HALO, running as a containerized service on Nexus and providing real-time object detection, intelligent event classification, and efficient video recording. Using local processing with Google Coral TPU acceleration attached to the Nexus host, Frigate delivers privacy-first security camera capabilities without cloud dependencies or recurring subscription fees.

As HALO’s eyes on the physical environment (also known as Horus within the subsystem context), Frigate continuously analyzes camera feeds to identify people, vehicles, animals, and other objects of interest. It distinguishes between meaningful events and noise, ensuring that alerts and recordings capture what matters while minimizing false positives and storage waste.

Purpose and Scope

Frigate’s mission within HALO is to provide intelligent security monitoring through computer vision. Rather than simply recording everything or relying on basic motion detection, Frigate applies real-time AI analysis to understand what’s happening in camera feeds. This intelligence enables sophisticated automation—triggering different responses based on whether a detected person is a mail carrier, a family member, or an unexpected visitor.

The system runs as a containerized service on Nexus with hardware acceleration from a Google Coral TPU attached to the host via USB passthrough, achieving 400+ frames per second of object detection throughput. This local processing ensures privacy (video never leaves the network), reduces latency (no cloud round-trip), and maintains functionality without internet connectivity.

Beyond real-time detection, Frigate manages video retention policies, snapshot archives, and event databases. It provides both live monitoring and forensic capabilities, allowing you to review what happened days or weeks ago while intelligently pruning unimportant footage to conserve storage.

Architecture and Design

Hardware Integration

Frigate leverages specialized hardware for optimal performance:

Google Coral TPU: A USB accelerator providing dedicated tensor processing for object detection. The Coral handles the computationally intensive neural network inference, achieving over 400 FPS detection rate while consuming minimal power. Attached to Nexus host with USB passthrough to the Frigate container.

Cameras: Reolink Duo Floodlight PoE cameras with dual lenses provide wide coverage of monitored areas. These cameras deliver high-resolution streams over PoE (Power over Ethernet), simplifying installation and providing reliable connectivity.

Storage: SATA SSD dedicated to recordings ensures write endurance for continuous video storage. Mounted as Docker volume to the Frigate container on Nexus.

Network: Gigabit PoE switch delivers both power and data to cameras, enabling central cable management and simplified installation.

Software Architecture

Frigate runs as a containerized service on Nexus with configuration stored in the HALO monorepo:

halo/
├── configs/frigate/
│   ├── config.yml              # Main configuration
│   ├── labelmap.txt            # Custom object labels
│   └── masks/                  # Privacy masks and zones
│       ├── front_door_mask.png
│       └── driveway_mask.png
└── nexus/compose/
    └── frigate.yml             # Docker container definition

This approach keeps configuration version-controlled while allowing Frigate to run as a standard container on Nexus with USB device passthrough for Coral TPU access and volume mounts for camera recordings.

Integration with HALO Systems

Home Assistant Integration

Frigate integrates natively with Home Assistant (both containerized on Nexus) through MQTT and custom integration:

Camera Entities: Live camera feeds appear in Home Assistant dashboards through Frigate integration, enabling monitoring alongside other device states.

Binary Sensors: Motion and object detection states become Home Assistant binary sensors, useful for automation triggers.

Event Sensors: Separate sensors for person detection, vehicle detection, and other object types enable fine-grained automation logic.

Notification Automation: Home Assistant automations can react to Frigate events published to MQTT, sending notifications with snapshots when interesting activity occurs.

Example Home Assistant automation:

automation:
  - alias: "Person Detected at Front Door"
    trigger:
      - platform: mqtt
        topic: "frigate/events"
    condition:
      - condition: template
        value_template: ""
      - condition: template
        value_template: ""
    action:
      - service: notify.mobile_app
        data:
          message: "Person detected at front door"
          data:
            image: "/api/frigate/notifications//snapshot.jpg"

Omnia Integration

Omnia widgets display Frigate data and controls by calling Frigate’s REST API through Traefik:

Live Camera Feeds: Real-time video streams embedded in dashboard widgets show current camera views from https://halo.local/frigate/api.

Event Timeline: Chronological display of detection events with thumbnail snapshots, filterable by camera, object type, and time range.

Zone Status: Indicators showing which defined zones currently have detected objects.

Recording Playback: Interface for reviewing recorded footage with timeline scrubbing and event markers.

Snapshot Gallery: Browsable collection of captured snapshots from detection events, useful for reviewing activity patterns.

These widgets transform Frigate’s raw data into accessible interfaces for everyday monitoring.

Apollo Integration

Apollo can query Frigate to answer security-related questions by making HTTP requests to Frigate’s REST API:

Event Queries: “Did anyone come to the door today?” triggers Apollo to query Frigate’s event API at https://halo.local/frigate/api/events, filter for person detections at the front door camera, and present results in natural language.

Pattern Analysis: “Is there unusual activity today?” allows Apollo to compare current detection counts from the API against historical averages and flag anomalies.

Recording Access: “Show me the driveway camera” returns the appropriate stream URL from Frigate’s API for display in Omnia or direct viewing.

Example tool call:

User: "Did anyone come to the door today?"
Apollo: Yes, there were 3 person detections at the front door:
        • 9:23 AM - Mail carrier (confidence: 94%)
        • 2:15 PM - Package delivery (confidence: 98%)
        • 5:47 PM - Neighbor walking by (confidence: 89%)
        [Queries: GET /api/events?camera=front_door&label=person&after=today]

n8n Workflow Integration

n8n workflows running on Nexus orchestrate complex responses to Frigate events:

Package Delivery Detection: Workflow detects package object near front door through MQTT subscription, captures snapshot via Frigate API, sends notification, and logs delivery time.

Unexpected Vehicle Alert: When a vehicle is detected while the household is away (via MQTT event), workflow sends alert with photo retrieved from Frigate API and checks against known license plates.

Pet Activity Monitoring: Tracks when pets enter or exit specific zones through MQTT events, useful for ensuring outdoor pets return before nighttime.

Visitor Log: Records all person detections with timestamps and snapshots to a database for security audit trail.

Multi-Stage Alerts: Escalating notifications for persistent events (person loitering in one area for extended period) detected through MQTT state monitoring.

Object Detection

Supported Object Types

Frigate uses the COCO dataset model supporting 80 object classes:

Commonly Used: person, bicycle, car, motorcycle, bus, truck, dog, cat, bird, backpack, handbag, suitcase

Full List: Includes sports equipment, furniture, electronics, food items, and many more categories

Detection Zones

Zones define specific areas within camera views for targeted monitoring:

zones:
  front_porch:
    coordinates: 0,461,3,0,1919,0,1919,843,1699,492,457,522
    objects:
      - person
      - package
    filters:
      min_area: 5000 # Minimum pixels to trigger
      max_area: 100000 # Avoid false positives from large objects
      threshold: 0.7 # Require 70% confidence

  driveway:
    coordinates: 227,211,736,194,1084,491,767,507,221,375
    objects:
      - car
      - person
    filters:
      threshold: 0.75 # Higher confidence for vehicle detection

Zones enable context-aware detection—a person in the driveway might be normal, while a person near the back window at night is worth alerting.

Detection Tuning

Fine-tune detection to reduce false positives and improve accuracy:

objects:
  filters:
    person:
      min_area: 2000
      max_area: 100000
      threshold: 0.75 # Require 75% confidence
      min_score: 0.60 # Minimum detection score
    car:
      mask: driveway_only # Only detect cars in specific area
      threshold: 0.80 # Higher threshold for vehicles

These filters balance detection sensitivity with false positive rates, adapting to each environment’s characteristics.

Camera Configuration

Camera Setup

Each camera requires configuration for streams, detection parameters, and recording policies:

cameras:
  front_door:
    ffmpeg:
      inputs:
        - path: rtsp://admin:password@192.168.1.10:554/h264Preview_01_main
          roles:
            - detect
            - record
    detect:
      width: 1920
      height: 1080
      fps: 5 # Detection frame rate
    objects:
      track:
        - person
        - car
        - dog
        - package
    zones:
      porch:
        coordinates: 0,461,3,0,1919,0,1919,843,1699,492,457,522
      driveway:
        coordinates: 227,211,736,194,1084,491,767,507,221,375
    snapshots:
      enabled: true
      timestamp: false
      bounding_box: true
      crop: true
      quality: 100
    record:
      enabled: true
      retain:
        days: 7
        mode: motion
      events:
        retain:
          default: 14
          mode: active_objects

This configuration balances detection accuracy, recording storage, and event retention.

Stream Optimization

Frigate supports multiple stream roles for optimal performance:

Detect Stream: Lower resolution (720p or 1080p) at 5-10 FPS for object detection. This reduces processing load while maintaining detection accuracy.

Record Stream: Higher resolution (1080p or 4K) at 15-20 FPS for quality recordings. This stream is written to disk only when events occur (depending on recording mode).

RTSP Restream: Frigate can restream cameras for viewing in other applications without additional camera connections.

Event Management

Event Lifecycle

Events are created and managed through a structured lifecycle:

Event Start: Object first detected in a configured zone triggers event creation

Event Update: Object position, confidence score, and zone updates occur throughout tracking

Event End: Object leaves the zone or drops below confidence threshold for configured timeout period (default: 30 seconds)

Snapshot Capture: Best frame (highest confidence score) saved as snapshot

Clip Generation: Video clip extracted from recordings covering the event duration

Recording Modes

Different recording strategies balance storage usage with coverage:

Continuous: Always recording, regardless of motion or objects. Provides complete footage but consumes maximum storage. Not recommended for most scenarios.

Motion: Record when any motion detected in the frame. Captures more context than events-only but includes many false positives.

Active Objects: Record only when tracked objects are present. This is the recommended mode—balances storage efficiency with comprehensive event coverage.

Events Only: Record only during classified events. Minimizes storage but may miss context before/after events.

Retention Policies

Configure retention separately for recordings and events:

record:
  enabled: true
  retain:
    days: 7 # Keep all motion recordings for 7 days
    mode: motion
  events:
    retain:
      default: 14 # Keep event recordings for 14 days
      objects:
        person: 30 # Keep person detections for 30 days
        car: 21 # Keep vehicle detections for 21 days

This granular control ensures important events are retained longer while routine footage is pruned to conserve storage.

Security and Privacy

Privacy Zones

Mask areas to exclude from detection and recording:

cameras:
  front_door:
    motion:
      mask:
        - 1920,0,1920,200,1600,200,1600,0 # Neighbor's window
        - 0,0,300,0,300,200,0,200 # Street sign with motion

Privacy masks prevent recording or analyzing areas like neighbor windows, public streets beyond property boundaries, or other sensitive areas.

Access Control

Security measures protect Frigate data:

  • API Authentication: All API endpoints require authentication tokens
  • Network Isolation: Frigate runs on isolated network, accessible only via local network and VPN
  • Stream Encryption: RTSP streams can use TLS encryption (RTSPS)
  • MQTT Security: Messages use authentication and can be encrypted

Data Retention

Control what data is kept and for how long:

  • Configurable retention per camera and object type
  • Automatic cleanup of old recordings based on age and storage thresholds
  • Export capability for archiving important events
  • Option to disable recording entirely (detection-only mode)

All data stays on local storage—nothing is uploaded to cloud services unless explicitly configured through separate integrations.

API Reference

REST API Endpoints

Frigate exposes a comprehensive REST API:

# Get recent events
GET /api/events?camera=front_door&label=person&limit=10

# Get latest camera snapshot
GET /api/front_door/latest.jpg

# Get specific event snapshot
GET /api/events/{event_id}/snapshot.jpg

# Get event clip
GET /api/events/{event_id}/clip.mp4

# Get camera configuration
GET /api/config

# Get system statistics
GET /api/stats

These endpoints enable integration with Omnia, Apollo, and n8n workflows.

MQTT Topics

Frigate publishes real-time data to MQTT:

# Event started/updated/ended
frigate/events → {camera, label, zone, score, snapshot_url}

# Camera snapshot (periodic updates)
frigate/front_door/snapshot → binary image data

# Person detection state
frigate/front_door/person → "ON" / "OFF"

# Camera statistics
frigate/front_door/stats → {fps, detection_fps, process_fps}

MQTT integration enables reactive automation in Home Assistant and n8n.

Directory Structure

Configuration and data organization:

# Configuration (in monorepo)
configs/frigate/
├── config.yml          # Main configuration
├── labelmap.txt        # Custom object labels
└── masks/              # Zone and privacy masks
    ├── front_door.png
    └── driveway.png

# Data (on host storage)
/mnt/storage/frigate/
├── recordings/
│   ├── front_door/
│   │   └── 2025-10-09/
│   └── driveway/
│       └── 2025-10-09/
├── snapshots/
│   ├── front_door/
│   └── driveway/
└── clips/
    ├── front_door/
    └── driveway/

Example Integrations

n8n Package Delivery Workflow

Workflow detecting package deliveries:

Trigger: MQTT - frigate/events
↓
Filter: camera = "front_door" AND label = "package"
↓
HTTP Request: GET /api/events/{event_id}/snapshot.jpg
↓
Database Insert: Log delivery time and snapshot path
↓
Notification: Send alert with image
  Title: "Package Delivered"
  Message: "Package detected at front door"
  Image: Snapshot from event

Omnia Security Widget

JavaScript code for displaying recent events:

async function getRecentEvents(camera = null, limit = 20) {
  const params = new URLSearchParams({ limit });
  if (camera) params.append("camera", camera);

  const response = await fetch(
    `http://frigate.local:5000/api/events?${params}`
  );
  const events = await response.json();

  return events.map((event) => ({
    camera: event.camera,
    label: event.label,
    timestamp: new Date(event.start_time * 1000),
    snapshot: `http://frigate.local:5000/api/events/${event.id}/snapshot.jpg`,
    confidence: Math.round(event.score * 100),
    zones: event.zones.join(", "),
  }));
}

Apollo Tool Definition

Python code defining Frigate tools for Apollo:

@tool
def get_camera_events(
    camera: str,
    label: str = None,
    after: str = "today",
    limit: int = 10
) -> list:
    """Get recent events from Frigate security cameras."""
    params = {"camera": camera, "limit": limit}
    if label:
        params["label"] = label
    if after == "today":
        params["after"] = int(datetime.now().replace(
            hour=0, minute=0, second=0
        ).timestamp())

    response = requests.get(
        f"{FRIGATE_URL}/api/events",
        params=params
    )
    return response.json()

Roadmap and Future Development

Planned enhancements to Frigate integration:

Face Recognition: Identify known family members vs unknown visitors using facial recognition models

License Plate Recognition: Automatically read license plates for vehicle tracking and access control

Sound Detection: Audio analysis for glass breaking, alarms, baby crying, or other important sounds

Cross-Camera Tracking: Follow objects as they move between camera views to create comprehensive activity timelines

Advanced Analytics: Dwell time analysis, traffic pattern visualization, occupancy counting

Security System Integration: Arm/disarm coordination with alarm systems based on detection patterns

Mobile Push Notifications: Direct push notifications with live view capability from mobile apps

Two-Way Audio: Interactive communication through supported cameras

Monorepo Integration

Frigate configuration is part of the HALO monorepo structure:

  • Configuration Location: configs/frigate/ stores YAML configuration and mask images
  • Container Deployment: nexus/compose/frigate.yml defines the Docker container with USB and volume mounts
  • API Access: Available at https://halo.local/frigate (proxied through Traefik)
  • Integration Points: Called by Apollo tools, n8n workflows, and Omnia widgets
  • Data Flow: Cameras → Frigate (on Nexus) → MQTT → Home Assistant → HALO workflows

This organization keeps configuration versioned alongside the rest of HALO while running Frigate as a containerized service on Nexus with necessary hardware access (Coral TPU via USB passthrough) and proper ingress control through Traefik.

For camera configuration details, see Frigate Cameras.

For integration with other HALO systems, see Home Assistant, Apollo, and n8n Workflows.

For hardware and deployment details, see Nexus Hardware and Container Reference.


Back to top

Copyright © 2024-2025 HALO Project. All rights reserved.