Works with

How it works
A camera streams video to Frigate, Frigate finds people with a ready-compiled model on the DEEPX NPU, and a Python listener acts on Frigate’s MQTT messages. The NPU runs only the YOLOv8n object detection model and its post-processing; Frigate’s decoding, motion detection and tracking, and the listener run on the Raspberry Pi 5 CPU. Frigate and the listener are separate programs that talk only through MQTT; no Home Assistant is involved.
- The camera streams video over RTSP.
- Frigate’s DEEPX detector runs
yolov8n-ppu-coco80.dxnnon the NPU. Person is class 0 in COCO-80. - Frigate publishes tracked-object messages on the
frigate/eventsMQTT topic. notify.py, a Python listener that runs as a user-level systemd service, callstrigger_alert()for each person message that passes its score and cooldown rules: see Listener,notify.py.trigger_alert()publishes a JSON alert toboss_detector/alertand writes aBOSS DETECTEDlog line.
Read the alerts on the boss_detector/alert topic: each one carries the camera name, the score and a Unix timestamp. The listener’s log holds the matching BOSS DETECTED line, and Frigate’s web interface at https://[PI_IP]:8971 draws the person box.
Requirements
Set things up in this order: the AI HAT+ quickstart, then Frigate NVR on Raspberry Pi 5 with the DEEPX NPU, then Camera feeds and MQTT for the camera and the broker. The Frigate setup page holds the full docker run command for Frigate; this page changes only the camera and model config and restarts Frigate.
Hardware
- Raspberry Pi 5
- Sixfab AI HAT+ (DEEPX DX-M1M)Set up as in the AI HAT+ quickstart.Shop
- RTSP cameraAny RTSP camera or stream.
Software
- Frigate NVR with the DEEPX detectorSet up first: Frigate NVR on Raspberry Pi 5 with the DEEPX NPU.
- MQTT brokerOn your network, accepting connections on port 1883 without a user name, password or TLS, for example Mosquitto.
- Tools
git,curl,sha256sumandpython3.
The project brings the model file yolov8n-ppu-coco80.dxnn (downloaded from the project’s GitHub release into its model folder), the listener notify.py, the service file boss-detector-automation.service and the Python package paho-mqtt v1.x.
DEEPX support is not in a stable Frigate release
DEEPX support was merged into Frigate’s dev branch on September 21, 2026 (PR #24336) and is not in a stable release yet; the latest stable release is v0.18.0 (September 12, 2026). Sixfab develops and maintains it (Frigate’s DEEPX NPU detector docs). The image ghcr.io/blakeblackshear/frigate:af0ba19-standard-arm64, published on GitHub Container Registry, is built from commit af0ba19 of the dev branch; the Frigate setup page pulls it.
Install
Both methods put the model in Frigate’s model cache, merge the model and one camera into your Frigate config.yaml, install the listener as a user service in ~/sixfab-apps/boss-detector and restart Frigate.
Run on the Raspberry Pi 5 as your normal user:
git clone https://github.com/sixfab/sixfab-dx-frigate.git
cd sixfab-dx-frigate/apps/boss-detector
./install.sh --rtsp-url [RTSP_URL] --broker [BROKER_HOST]
--rtsp-url: the RTSP address of your camera.--broker: the host of your MQTT broker.--yes: restart the Frigate container without asking.
The installer asks for any value you leave out. It downloads the model from the project’s GitHub release and checks its SHA-256, copies it, merges the model and one camera into your Frigate config.yaml (after saving a backup), installs the listener as a user service in ~/sixfab-apps/boss-detector and offers to restart Frigate. It does not run enable-linger; it prints the command, which is step 6 of the manual install.
-
Clone repository and open project folder
git clone https://github.com/sixfab/sixfab-dx-frigate.git [REPO_DIR] cd [REPO_DIR]/apps/boss-detector -
Download model and check it
curl -fL -o model/yolov8n-ppu-coco80.dxnn https://github.com/sixfab/sixfab-dx-frigate/releases/download/boss-detector-v1.0.0/yolov8n-ppu-coco80.dxnnawk '$1 !~ /^#/ && NF {print $3 " " $2}' models.txt | sha256sum -c -model/yolov8n-ppu-coco80.dxnn: OKOKmeans the file matches its SHA-256 inmodels.txt. -
Copy model into Frigate’s model cache
mkdir -p [FRIGATE_CONFIG_DIR]/model_cache cp model/yolov8n-ppu-coco80.dxnn [FRIGATE_CONFIG_DIR]/model_cache/ -
Add model and camera to
[FRIGATE_CONFIG_DIR]/config.yamlKeep a backup of the file first. Merge the entries into your existing
modelslist andcamerassection; do not replace your own cameras. Use your own camera name and[RTSP_URL].models: - scene: indoor_thermal model_type: yolo-generic width: 640 height: 640 path: /config/model_cache/yolov8n-ppu-coco80.dxnn labelmap_path: /labelmap/coco-80.txt devices: - deepx:PCIe:0 cameras: cam1: ffmpeg: inputs: - path: [RTSP_URL] roles: - detect detect: enabled: true width: 1280 height: 720 scene: indoor_thermal objects: track: - person filters: person: min_score: 0.6 threshold: 0.7 record: enabled: falsescene: indoor_thermalis only an unused slot in Frigate’s fixed scene list that ties the camera to this model; no thermal camera is involved. If another model on your instance already usesindoor_thermal, choose another unused scene value. -
Install listener in its own Python virtual environment
mkdir -p ~/sixfab-apps/boss-detector cp automation/notify.py ~/sixfab-apps/boss-detector/notify.py cd ~/sixfab-apps/boss-detector python3 -m venv venv ./venv/bin/pip install "paho-mqtt<2"Set
BROKERin~/sixfab-apps/boss-detector/notify.pyto[BROKER_HOST]. -
Create user service and start it
Create
~/.config/systemd/user/boss-detector-automation.service:[Unit] Description=Boss Detector - Frigate MQTT person-detection trigger listener After=network-online.target Wants=network-online.target [Service] Type=simple WorkingDirectory=%h/sixfab-apps/boss-detector ExecStart=%h/sixfab-apps/boss-detector/venv/bin/python %h/sixfab-apps/boss-detector/notify.py Restart=on-failure RestartSec=5 [Install] WantedBy=default.targetsystemctl --user daemon-reload systemctl --user enable --now boss-detector-automation.serviceTo start the service after a reboot without logging in, run this once; it asks for your password:
sudo loginctl enable-linger $USER -
Restart Frigate so it loads new model and camera
docker restart frigate
Verify
-
Watch alerts listener publishes
Run this on any computer that can reach the broker, then walk into the camera view:
mosquitto_sub -h [BROKER_HOST] -t boss_detector/alert -vOne line arrives each time a person is detected, at most one per camera every 5 seconds (example values):
boss_detector/alert {"camera": "cam1", "score": 0.9, "timestamp": 1791267504.950264} -
Check Frigate and detector
Run the API check inside the container:
docker exec frigate curl -s http://localhost:5000/api/statsThe output is JSON with detector and camera statistics.
-
Confirm person box in Frigate UI
Open
https://[PI_IP]:8971, walk into the camera view and check that Frigate draws a person box on your camera. -
Optional: watch topic listener reads
mosquitto_sub -h [BROKER_HOST] -t 'frigate/events' -v
Frigate documents port 5000 as internal, unauthenticated access and treats every request there as admin-level. Run API checks through docker exec, and browse to port 8971 only.
Details
Model
The model is YOLOv8n with a 640 × 640 input and the Frigate model type yolo-generic. Its post-processing, which decodes the boxes and removes duplicates with non-maximum suppression (NMS), runs on the NPU’s Post-Processing Unit (PPU). The model is already compiled into a .dxnn file, DEEPX’s model format, and Frigate’s built-in label map /labelmap/coco-80.txt names class 0 person, so you train nothing. See the YOLOv8 documentation for the model family.
Listener, notify.py
The listener subscribes to frigate/events, parses each JSON message and keeps only person objects whose message type is new or update. It reads the score from top_score when the message has one, and from score otherwise, and skips scores below 0.6. It then calls trigger_alert() at most once every 5 seconds for each camera; the first sighting always fires at once.
A new message comes only once, when Frigate confirms a track, so the listener also acts on update messages, which Frigate sends as the person moves; the cooldown limits the repeats. Frigate’s tracker confirms a new object after min_initialized frames, which defaults to half the detect fps: 2 frames at 5 fps.
The frigate topic prefix is written into the code, so keep Frigate’s topic_prefix at its default. Set BROKER to your MQTT broker address; the listener connects without a user name or password.
"""Boss Detector - frigate/events listener.
Listens for Frigate person events on MQTT and calls trigger_alert().
Replace the action in trigger_alert() with your own; for now it logs the alert and publishes it to MQTT.
"""
import json
import logging
import time
import paho.mqtt.client as mqtt
BROKER = "[BROKER_HOST]" # replace with your MQTT broker address
PORT = 1883
EVENTS_TOPIC = "frigate/events"
ALERT_TOPIC = "boss_detector/alert" # this script publishes here on every alert
TARGET_LABEL = "person"
MIN_SCORE = 0.6
COOLDOWN_SECONDS = 5 # prevents spam - always fires on first sighting
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(message)s")
log = logging.getLogger("boss-detector")
_last_triggered: dict[str, float] = {}
def trigger_alert(client: mqtt.Client, camera: str, score: float) -> None:
"""Log the alert and publish it to ALERT_TOPIC as JSON.
Put your real action here.
Examples: requests.post(webhook_url, json=...), play a sound
(playsound), trigger a smart plug/light, print "BOSS INCOMING" on a
receipt printer, publish to Home Assistant via MQTT."""
log.warning("BOSS DETECTED camera=%s score=%.2f (simulated for now)", camera, score)
client.publish(
ALERT_TOPIC,
json.dumps({"camera": camera, "score": round(score, 2), "timestamp": time.time()}),
qos=1,
)
def on_connect(client: mqtt.Client, userdata, flags, rc):
if rc != 0:
log.error("MQTT connection error, rc=%s", rc)
return
log.info("Connected to broker (%s:%s), listening on %s", BROKER, PORT, EVENTS_TOPIC)
client.subscribe(EVENTS_TOPIC)
def on_message(client: mqtt.Client, userdata, msg: mqtt.MQTTMessage):
try:
payload = json.loads(msg.payload.decode())
except (json.JSONDecodeError, UnicodeDecodeError):
log.warning("Malformed payload, skipping")
return
after = payload.get("after") or {}
event_type = payload.get("type")
label = after.get("label")
if label != TARGET_LABEL:
return
# Both "new" AND "update" trigger - notified as soon as the person is
# seen (first "new" event, published ~0.4s in) and again as they move
# (each "update"). Only cooldown prevents spam, not the event type.
if event_type not in ("new", "update"):
return
camera = after.get("camera")
score = after.get("top_score") or after.get("score") or 0.0
if score < MIN_SCORE:
log.debug("Score below threshold (%.2f < %.2f), skipping", score, MIN_SCORE)
return
now = time.monotonic()
last = _last_triggered.get(camera, 0.0)
if now - last < COOLDOWN_SECONDS:
log.info(
"Person detected again but still in cooldown (%.0fs left), skipping",
COOLDOWN_SECONDS - (now - last),
)
return
_last_triggered[camera] = now
trigger_alert(client, camera, score)
def main() -> None:
client = mqtt.Client()
client.on_connect = on_connect
client.on_message = on_message
client.connect(BROKER, PORT, keepalive=60)
client.loop_forever()
if __name__ == "__main__":
main()
The log line says “(simulated for now)” because no physical output is connected. Replace the placeholder in trigger_alert() with a sound, a light, a receipt printer or a Home Assistant webhook (see Frigate’s Home Assistant integration).
Never switch mains power from GPIO
Drive the action with low-voltage devices or a certified smart plug.
Frigate MQTT topics
frigate/events carries one message per changed tracked object, which suits a per-person action. The table compares it with two other topics from Frigate’s MQTT topic reference; Camera feeds and MQTT lists the message fields each project listener reads.
| Topic | What Frigate sends | Fit for a per-person action |
|---|---|---|
frigate/events | One message per changed tracked object, typed new, update or end | Per tracked person |
frigate/reviews | One message per changed review item, with alert or detection severity | Per review item, which can hold several objects |
frigate/<camera-name>/person | The count of people on that camera | A count, not an event; suits sensors |
Limitations
Tested on a Raspberry Pi 5 (8 GB) with the Sixfab AI HAT+ (DEEPX DX-M1M), Raspberry Pi OS Trixie 64-bit, RT driver v2.6.0, PCIe driver v2.5.0, DX-RT v3.4.2 on the Raspberry Pi 5 and v3.4.0 in Frigate’s DEEPX detector, firmware v2.7.4, ghcr.io/blakeblackshear/frigate:af0ba19-standard-arm64 and a live IP camera over RTSP; last tested October 5, 2026.
- Speed is not measured: there are no figures for inference time, detection frame rate, NPU or CPU load, person-to-log latency, missed people or false alerts. To measure your setup, read the detector figures from the
/api/statsoutput in Verify, and check NPU load withdxtop. - The listener cannot tell who a person is, so it cannot tell your boss from anyone else. It was tested with a porch camera stream, not a desk camera.
- The listener acts on events from every camera on the broker; it does not filter by camera name.
- The listener de-duplicates only by time, one trigger per camera every 5 seconds. It does not track event IDs, so a person who stays in view longer than 5 seconds triggers again, and a person who leaves and returns triggers after the cooldown.
- The listener connects to the broker on port 1883 without credentials or TLS, so it works only with a broker that allows that.
- Tested with Frigate in Docker. Home Assistant OS and the Frigate add-on were not tested.
- Port 5000 has no authentication. Frigate runs with host networking, so the port is on the Raspberry Pi 5’s network with no Docker
-pflag to leave it unpublished; firewall it. - Frigate chooses the DX-RT version its DEEPX detector uses. The tested build pins DX-RT v3.4.0, and this project cannot change it.
- If the DX-RT daemon (the DEEPX runtime) restarts, restart the Frigate container too.
Privacy
A camera that watches people records personal data. Point it at your own space and tell people it is there.
- Recording at work can be regulated. Check your local rules; this project makes no compliance claim.
- Keep the “boss” idea light. Do not use it to watch coworkers in secret.
- The camera block sets
record: enabled: false, so this camera does not record video. Check your ownrecordand snapshot settings, globally and per camera: recordings and snapshots can store images of people. - Frigate downloads the DX-RT Python bindings at first start, and again when a release pins a new version, so the first start needs internet access.
- The listener talks only to your MQTT broker, normally on your local network. It publishes the camera name, a score and a timestamp to
boss_detector/alert, so anyone who can read that broker can see when a person appeared.
Troubleshooting
Check the listener service first, then the alert topic, then the cooldown. For Frigate and detector problems, see Troubleshooting on the Frigate setup page.
Read the last 30 log lines:
systemctl --user status boss-detector-automation.service --no-pager -n 30
A healthy service is active (running) and its log shows Connected to broker (...), listening on frigate/events at startup. If the log shows MQTT connection error, check BROKER and PORT in notify.py, and that the broker is reachable from the Raspberry Pi 5.
Check in this order: the person box in the Frigate UI, the detector section of /api/stats, and the raw messages on frigate/events with mosquitto_sub. The listener also skips person messages by its score and cooldown rules: see Listener, notify.py.
The listener received the person and the 5-second cooldown suppressed the alert. This is expected while a person stays in view.
Raise COOLDOWN_SECONDS in notify.py (default 5). The listener allows one trigger per camera in each cooldown window and does not track Frigate’s event IDs, so a person who stays in view past the window triggers again.
Next steps
- Porch Pirate Zone and sequence logic: Frigate package detection.
- Face recognition Recognize who is there with Frigate.
- Squirrel detector Another MQTT listener, for squirrels.
- Sixfab Model Zoo Pre-compiled .dxnn models for the NPU.
- Choose project All projects with the DEEPX NPU.
License and credits
The code is licensed under the MIT License. Each model file has its own license, listed with the model details in the release notes at https://github.com/sixfab/sixfab-dx-frigate/releases/tag/boss-detector-v1.0.0; YOLOv8n is AGPL-3.0.
Credits: YOLOv8n by Ultralytics, and Frigate NVR.