Some hardware links on this page are affiliate links. We may earn a commission if you buy through them, at no extra cost to you. See the affiliate disclosure.
A PTZ security camera already has a motor, a zoom, and a snapshot path. This workflow parks it on a sky pose, turns auto-tracking off, retriggers autofocus, then walks pan between two helper numbers while it writes frames. When you stop, tracking and the previous pose come back.
The write-up talks about an outdoor PTZ, not about which opening, yard, or window a camera covers. Point it at sky, not at neighbors.
How it works
- Start script — turn auto-tracking off, set zoom near zero, tilt/pan to the sky pose stored in helpers, fire autofocus, wait a beat.
- Sweep — a repeat loop pans between
sweep_startandsweep_endon an interval you pick (clouds: slower; fast cells: faster). - Snapshot — each tick writes
camera.snapshotinto a dated folder in HA media (or a mounted share). - Stop script — cancel the loop, restore tracking, optionally return to a “watch the approach” pose of your choosing. That restore pose stays in your config; it is not in the public snippet.
- Stitch — an
ffmpegone-liner in the pack turns the folder into an mp4.
No stills from a real property ship with the pack. Test with a bench camera or a cloudy sky.
Snippet
Entity ids are blueprint inputs, not a live install:
script:
storm_timelapse_start:
sequence:
- service: switch.turn_off
target:
entity_id: !input ptz_auto_tracking
- service: number.set_value
target:
entity_id: !input ptz_zoom
data:
value: 0
- service: number.set_value
target:
entity_id: !input ptz_tilt
data:
value: "{{ states('input_number.sky_tilt') }}"
# autofocus retrigger + sweep: full scripts in the pack
Helpers to add
input_numbersky tiltinput_numbersweep start / sweep end (pan)input_numberinterval secondsinput_booleantimelapse running (so a second start is a no-op)
Troubleshooting
- Soft frames. Autofocus was still hunting. The start script waits; bump that delay or retrigger focus every N frames.
- Integration has no zoom/tilt numbers. Some camera brands expose PTZ only as services (
onvif, manufacturer). The pack includes a service-call variant. - Disk fills up. Interval of 2 s on a 4K cam is a lot. Start at 5–8 s; prune the dated folder after
ffmpeg. - Tracking does not resume. Stop script must run even if you abort. Bind it to a dashboard button, not only to an automation.
Privacy
Do not publish timelapse frames, EXIF, or a map of where the camera sits. This page is the control pattern only.