Dominevo
ReferenceDevice capabilities

ptz-autotrack

ptz-autotrack — sibling cap of ptz that exposes the on-camera smart-tracking subsystem (subject-following).

ptz-autotrack — sibling cap of ptz that exposes the on-camera smart-tracking subsystem (subject-following). Modeled separately from ptz because:

  • Not every PTZ-capable camera has autotrack (Reolink: yes; Hikvision: model-dependent), so a single combined cap would force every PTZ provider to surface Unsupported stubs on half the methods.
  • The cap's lifecycle is "registered when probed-true" — the binding system can show / hide the UI affordance cleanly via the standard provider-registered signal.
  • Autotrack on/off is a device-state toggle (status), distinct from PTZ's continuous control surface — a status-driven cap fits the existing setStatus / onStatusChanged pattern better than ptz's discrete-action surface.

Settings (cross-vendor consolidation, sourced from Reolink's setAutotrackingSettings shape; expandable as Hikvision / Dahua / others land):

  • targetType — vendor target string (people / vehicle / pet / '' = camera default)
  • stopDelaySeconds — how long to keep tracking a stationary target before stopping (0..300, default 30)
  • disappearDelaySeconds — how long to wait before releasing a target that has left the frame (0..300, default 15)

The driver is the source of truth for which settings keys it actually honours; unsupported keys silently fall back to the camera's defaults. Adding a new vendor's setting (e.g. Hikvision's trackingDuration) extends the schema below and the setSettings payload.

At a glance

Capabilityptz-autotrack
Provided byThe device's own driver can provide it, and an addon can also wrap the device to provide it through the device bindings.
Active providers per deviceone
Device typescamera
Device settingsYes: its settings section on the device page is built from this capability's methods.
Sourcepackages/types/src/capabilities/ptz-autotrack.cap.ts

Methods

Every method takes the device id (deviceId) to address the device; the input tables below list the other fields.

MethodKindRequired of a providerAccess
getStatusqueryyesdefault
setEnabledmutationyesdefault
getSettingsqueryyesdefault
setSettingsmutationyesdefault

getStatus

query

Read the current on/off state + last-applied settings. Drivers may serve from a cache + refresh on a schedule — callers should NOT poll faster than ~5s.

Input

No fields besides deviceId.

Output

FieldTypeRequiredDescription
enabledbooleanyesTrue when autotrack is currently armed on the camera.
lastChangedAtnumberyesMs epoch of the last on/off transition (0 if never observed).
currentSettings{ targetType: string; stopDelaySeconds: number; disappearDelaySeconds: number } | nullyesCurrently-applied settings the camera reports. Drivers fill this from the firmware GET so the UI can echo what's really active vs the operator-typed values in the settings form.
supportedTargetTypes({ value: string; label: string })[]yesTarget types the camera advertises. Driver-supplied — Reolink exposes people / vehicle / pet, Hikvision exposes auto / human / vehicle when the <smartTrackingType> knob is supported. Empty array = vendor doesn't expose a selector (treat as auto-only). The UI renders these as the targetType field options without hardcoding a vendor-specific list.

setEnabled

mutation

Arm or disarm autotrack. Resolves once the camera has acknowledged the transition; the onStatusChanged event fires shortly after with the live state.

Input

FieldTypeRequiredDescription
enabledbooleanyes

Output

Nothing.

Actions (offered in automations and on device cards)

ActionLabelSets
ptz.autotrackOnAutotrack on
ptz.autotrackOffAutotrack off

getSettings

query

Read settings (target type + delays). Mirrors the getStatus().currentSettings payload but exposes it as a standalone read for callers that want settings without the status surface around them. null until the driver has harvested the firmware state at least once.

Input

No fields besides deviceId.

Output

FieldTypeRequiredDescription
targetTypestringyesVendor target string (people/vehicle/pet); empty = camera default
stopDelaySecondsnumberyes
disappearDelaySecondsnumberyes

setSettings

mutation

Update one or more settings. Partial — keys that aren't supplied keep their last persisted value. The driver is responsible for clamping vendor-specific ranges if narrower than the cross-vendor max declared on the schema.

Input

FieldTypeRequiredDescription
settings{ targetType?: string; stopDelaySeconds?: number; disappearDelaySeconds?: number }yes

Output

Nothing.

Runtime state

The state Dominevo keeps for each device with this capability, readable without calling the provider.

Persistent slice mirrored across restarts. The provider writes here on every successful firmware fetch / settings push; getStatus and getSettings then read this snapshot synchronously with a stale-driven async refresh in the background. Keeps the fetch / cache / fallback logic out of the four cap methods — they become trampolines over runtimeState.

FieldTypeRequiredDescription
enabledbooleanyes
lastChangedAtnumberyes
currentSettings{ targetType: string; stopDelaySeconds: number; disappearDelaySeconds: number } | nullyes
supportedTargetTypes({ value: string; label: string })[]yes
lastFetchedAtnumberyesMs epoch of the last successful camera fetch (0 = never).

Status

FieldTypeRequiredDescription
enabledbooleanyesTrue when autotrack is currently armed on the camera.
lastChangedAtnumberyesMs epoch of the last on/off transition (0 if never observed).
currentSettings{ targetType: string; stopDelaySeconds: number; disappearDelaySeconds: number } | nullyesCurrently-applied settings the camera reports. Drivers fill this from the firmware GET so the UI can echo what's really active vs the operator-typed values in the settings form.
supportedTargetTypes({ value: string; label: string })[]yesTarget types the camera advertises. Driver-supplied — Reolink exposes people / vehicle / pet, Hikvision exposes auto / human / vehicle when the <smartTrackingType> knob is supported. Empty array = vendor doesn't expose a selector (treat as auto-only). The UI renders these as the targetType field options without hardcoding a vendor-specific list.

Events

onStatusChanged

FieldTypeRequiredDescription
deviceIdnumberyes
status{ enabled: boolean; lastChangedAt: number; currentSettings: { targetType: string; stopDelaySeconds: number; disappearDelaySeconds: number } | null; supportedTargetTypes: ({ value: string; label: string })[] }yes