How iceteasa/unifi-ptz-better-patrol works
UniFi PTZ Better Patrol is a motion-aware patrol service for UniFi Protect PTZ cameras. An operator configures patrol behavior, then the service discovers cameras and presets, patrols those positions, and pauses or backs off for motion, tracking, or manual control. The README also documents scheduling, camera-specific overrides, automatic Protect-setting changes, re-authentication, and shutdown behavior. Source excerpts were unavailable, so implementation-level calls between scripts are not asserted; documented relationships are cited to the README, and uncertain links are marked unverified.
Main entry points: ptz-patrol.sh Patrol process · config.json.example Patrol settings · discover.sh Camera discovery · api.sh Protect API access
Components 10
Configuration and control
- Patrol settings
config.json.example - Systemd service
ptz-patrol.service
Patrol runtime
- Patrol process
ptz-patrol.sh - Schedule and overrides
ptz-patrol.sh - Activity monitoring
ptz-patrol.sh
Protect integration
- Camera discovery
discover.sh - Protect API access
api.sh
Other components
- Operator
- UniFi Protect NVR
- PTZ cameras
Connections 12
- Operator → Patrol settings: edits
README.md - Patrol settings → Patrol process: configures
README.md - Systemd service → Patrol process: starts or restarts
README.md - Patrol process → Camera discovery: discovers cameras
- Patrol process → Protect API access: uses
- Protect API access → UniFi Protect NVR: authenticates and requests
- Camera discovery → UniFi Protect NVR: finds cameras and presets
- Patrol process → PTZ cameras: moves through presets
README.md - PTZ cameras → Activity monitoring: provides activity state
README.md - Schedule and overrides → Patrol process: limits patrol
README.md - Activity monitoring → Patrol process: pauses or backs off
README.md - Patrol process → UniFi Protect NVR: adjusts Protect settings
README.md