Journal

Smart Perimeter Defense: Frigate Person Detection Triggers Outdoor Light Choreography

Smart Perimeter Defense: ไฟกลางแจ้งอัตโนมัติและ PTZ ตอบสนองต่อการตรวจจับคน Frigate

May 12, 2026 · 1 min read
Smart Perimeter Defense: Frigate Person Detection Triggers Outdoor Light Choreography

Why Smart Perimeter Defense Matters

Conventional CCTV records incidents but doesn’t deter proactively. Combining Frigate NVR with Home Assistant lets your property react immediately when a person enters a defined zone — making intruders aware they’ve been spotted while simultaneously alerting the homeowner.

Zone-Based Perimeter Architecture

Zone 1 (Gate)      → Lights flash 3x + recording starts Zone 2 (Driveway)  → Flood lights 100% + LINE notification Zone 3 (Porch)     → Siren + PTZ pan + push notification

Each zone is a polygon drawn on the camera frame inside Frigate config. Home Assistant automations fire different responses based on published over MQTT.

Frigate config.yml: Zone Detection Setup

yaml cameras:   front_gate:     ffmpeg:       inputs:         - path: rtsp://192.168.1.201:554/stream1           roles: [detect, record]     detect:       width: 1920       height: 1080       fps: 5     zones:       gate_zone:         coordinates: 100,300,500,300,500,800,100,800         objects:           - person       driveway_zone:         coordinates: 500,200,1400,200,1400,900,500,900         objects:           - person     record:       enabled: true       events:         retain:           default: 10     snapshots:       enabled: true       bounding_box: true

Home Assistant Automation: Zone Entry Sequence

yaml alias: Perimeter Defense — Gate Zone Person trigger:   - platform: mqtt     topic: frigate/events     value_template: >-       {{ value_json.after.camera == 'front_gate' and          'gate_zone' in value_json.after.current_zones and          value_json.after.label == 'person' }}     payload: 'true' condition:   - condition: time     after: "18:00:00"     before: "06:00:00" action:   - service: light.turn_on     target:       entity_id: light.gate_flood     data:       brightness_pct: 100       flash: short   - delay: "00:00:02"   - service: light.turn_on     data:       brightness_pct: 100       flash: short     target:       entity_id: light.gate_flood   - service: notify.line_notify     data:       message: >-         ⚠️ Person detected at gate {{ now().strftime('%H:%M') }}         Snapshot: http://frigate.local/api/events/{{ trigger.payload_json.after.id }}/snapshot.jpg mode: single

PTZ Camera via ONVIF Integration

PTZ cameras supporting ONVIF (Hikvision, Dahua, Reolink) can be commanded from HA:

yaml camera:   - platform: onvif     host: 192.168.1.202     username: admin     password: !secret ptz_password     name: Porch PTZ

Define presets on the camera’s web interface (gate-facing, walkway-facing, etc.), then call them in automations with through .

Zone Response Matrix

| Zone | Daytime | Night | Alert | |---|---|---|---| | Gate | Record + snapshot | Flash lights + LINE | Always | | Driveway | LINE photo | Flood + siren 5s | Always | | Porch | Push + snapshot | PTZ + siren 10s + strobe | Always |

Preventing False Positives

Frigate’s object tracking means a single event won’t re-trigger, but add a 60-second cooldown to handle pets or passing vehicles:

yaml condition:   - condition: template     value_template: >-       {{ (now() - states.automation.perimeter_driveway.last_triggered).seconds > 60          if states.automation.perimeter_driveway.last_triggered else true }}

ROI Summary

A Frigate + HA Smart Perimeter Defense system reduces intrusion response time from ~3 minutes (reviewing footage) to immediate, at 60–80% lower hardware cost than commercial CCTV monitoring systems.

Questions & answers

How accurate is Frigate person detection at night?
Frigate uses Google Coral TPU or CPU for inference — use IR night-vision cameras and set min_score to at least 0.65 to minimize false positives in low-light conditions.
Is a PTZ camera required?
No — the system works with fixed-angle cameras, but PTZ adds the ability to automatically pan toward the triggered zone for a better view.
How many cameras can the system handle?
Frigate supports multiple cameras on a single server, limited by CPU/GPU capacity. A Google Coral TPU handles 4–8 cameras smoothly.
Can alerts be sent to LINE?
Yes — Home Assistant’s LINE Notify integration sends text plus Frigate API snapshot URLs to LINE groups or individuals instantly.

Related reading