Dominevo
ReferenceDevice capabilities

ptz

What a preset id DOES on this camera.

What a preset id DOES on this camera.

On several PTZ firmwares the preset namespace is shared: low ids are stored positions, a reserved band triggers camera FUNCTIONS. The dispensa camera (Hikvision) returns its own reserved band in the preset list, named by the firmware:

34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode 92 Set manual limits · 93 Save manual limits · 94 Remote reboot 95 Call OSD menu

Saving over one is what produced PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500: the camera refusing to let "Back to origin" be overwritten, surfaced to the operator as a transport failure.

A function preset stays fully usable as a DESTINATION -- goToPreset('34') is the single most useful thing that camera can do. Only savePreset and deletePreset are gated.

At a glance

Capabilityptz
Provided byThe device's own driver provides it: each device registers its own provider.
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.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
movemutationyesdefault
continuousMovemutationyesdefault
goHomemutationyesdefault
getPresetsqueryyesdefault
goToPresetmutationyesdefault
savePresetmutationyesadmin
deletePresetmutationyesadmin
getOptionsqueryyesdefault
stopmutationyesdefault
getHomePresetqueryyesdefault
setHomePresetmutationyesadmin
captureHomeHeremutationyesadmin
getHomeReturnqueryyesdefault
setHomeReturnmutationyesadmin
getPositionqueryyesdefault
setAutofocusmutationyesdefault

move

mutation

Input

FieldTypeRequiredDescription
pannumberno
tiltnumberno
zoomnumberno
speednumberno

Output

Nothing.

continuousMove

mutation

Input

FieldTypeRequiredDescription
pannumberno
tiltnumberno
zoomnumberno
speednumberno

Output

Nothing.

goHome

mutation

Move to the camera's configured home preset. THROWS when getHomePreset() resolves to none -- a head that did not move must never look like a head that went home.

Input

No fields besides deviceId.

Output

Nothing.

Actions (offered in automations and on device cards)

ActionLabelSets
ptz.goHomePTZ go home

getPresets

query

Input

No fields besides deviceId.

Output

({ id: string; name: string; fn: "home" | "day-mode" | "night-mode" | "day-night-auto" | "set-limits" | "save-limits" | "reboot" | "osd-menu" | null; writable: boolean })[]

goToPreset

mutation

Input

FieldTypeRequiredDescription
presetIdstringyes

Output

Nothing.

Actions (offered in automations and on device cards)

ActionLabelSets
ptz.goToPresetPTZ go to preset

savePreset

mutation

Input

FieldTypeRequiredDescription
presetIdstringyes
namestringyes

Output

Nothing.

Actions (offered in automations and on device cards)

ActionLabelSets
ptz.savePresetSave PTZ preset here

deletePreset

mutation

Input

FieldTypeRequiredDescription
presetIdstringyes

Output

Nothing.

getOptions

query

Input

No fields besides deviceId.

Output

Per-camera PTZ availability descriptor — drives the UI.

FieldTypeRequiredDescription
hasPanbooleanyes
hasTiltbooleanyes
hasZoombooleanyes
supportsPresetsbooleanyes
maxPresetsnumbernoMax number of named presets the camera supports, when known.
hasAutofocusbooleanyesWhether the camera exposes a controllable autofocus toggle (boolean hasX per the getOptions availability convention).
speedStepsnumber | nullyesHow many distinct speeds this camera's NATIVE scale offers. The cap's speed is normalized 0..1 and each provider maps it down -- Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized value hides how coarse that really is: asking an amcrest for 0.37 is meaningless, because it has eight steps and three of them round to the same one. A loop that tunes its own gain has to know the granularity of the knob it is turning. null = the driver does not know, or the scale is continuous (ONVIF takes a float). Never a made-up number.
moveImpulseMsnumber | nullyesHow long ONE move pulse runs on this driver, ms. move is a self-terminating burst everywhere, but every provider hardcoded its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision, 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far did the head travel per pulse": without it a measured displacement has no gain to be divided into. null = the driver cannot say.

stop

mutation

Input

No fields besides deviceId.

Output

Nothing.

Actions (offered in automations and on device cards)

ActionLabelSets
ptz.stopStop moving

getHomePreset

query

Which preset goHome targets, and who decided it.

Input

No fields besides deviceId.

Output

Which preset goHome goes to, and WHO decided.

107 Camera camera Carol (reolink) preset 0 holds "stanza" 1438 Camera dispensa (hikvision) preset 1 holds "Credenza" 3836 Camera studio (amcrest) preset 1 holds "Preset1"

So goHome meant "go wherever the operator happened to save in slot 0 or 1", and two of the three swallowed the failure in a bare catch. For autotrack this is the HOTTEST path -- it runs every time a subject is released -- so it needs an answer that is true per camera and audible when it is missing.

source is what makes it honest:

  • operator -- picked in the UI, stored by the provider.
  • firmware -- the camera itself named a preset fn: 'home' (Hikvision's "Back to origin"), adopted as the default with nothing to configure.
  • native -- the driver homes WITHOUT a preset at all. ONVIF does: goHome is ptzAbsoluteMove({x:0, y:0, zoom:0}). presetId is null and that is not a failure -- there is nothing to pick, and the UI must offer no picker.
  • none -- nothing is configured and the camera names nothing. goHome REFUSES rather than moving the head somewhere arbitrary.

source === 'none' is the refusal condition, NOT presetId === null: the native case has no preset and homes perfectly well.

FieldTypeRequiredDescription
presetIdstring | nullyes
source"operator" | "firmware" | "native" | "none"yes

setHomePreset

mutation

Pin the home preset for this camera. null clears the operator's choice and falls back to whatever the firmware names, or to none.

Input

FieldTypeRequiredDescription
presetIdstring | nullyes

Output

Nothing.

Actions (offered in automations and on device cards)

ActionLabelSets
ptz.setHomePresetSet PTZ home preset

captureHomeHere

mutation

Make WHERE THE HEAD IS POINTING RIGHT NOW this camera's home.

setHomePreset takes a preset id, and a preset id is the wrong shape for the most natural thing an operator does: aim the camera, then say "here". It is also the only shape a camera whose home is NOT a preset can accept -- Reolink's home is a guard point, a stored position with no id at all, and hiding the control for that case (as the UI briefly did) left the one vendor with a native home unable to set it.

Each provider does it its own way: reolink setGrd with needSetPos, pinning the guard point here hikvision / amcrest save a preset, then pin it as home onvif REFUSES -- its home is the PTZ origin and cannot be moved

A provider that cannot honour it throws rather than silently doing nothing: an operator who pressed "set home here" and saw no error would believe it took.

Input

No fields besides deviceId.

Output

Nothing.

Actions (offered in automations and on device cards)

ActionLabelSets
ptz.captureHomeHereSet PTZ home here

getHomeReturn

query

Whether the camera returns home on its own when left idle, and after how long. null when it has no such behaviour at all.

Reolink's guard point carries one (timeout, freely settable in seconds). It is a real function of the camera that we did not expose at all, and it belongs next to the home it governs rather than in a vendor settings page nobody associates with Home.

Input

No fields besides deviceId.

Output

FieldTypeRequiredDescription
enabledbooleanyes
secondsnumberyes

setHomeReturn

mutation

Set both together. Refused by a camera with no idle-return behaviour.

They travel together for the same reason they are read together: the underlying write carries both, so setting one alone means reading the other back first and racing whoever else is writing.

Input

FieldTypeRequiredDescription
enabledbooleanyes
secondsnumberyes

Output

Nothing.

Actions (offered in automations and on device cards)

ActionLabelSets
ptz.setHomeReturnSet PTZ return home

getPosition

query

Pull the current PTZ position. Redundant with the auto-injected getStatus method (see status below); kept for callers that haven't migrated. Will be folded into getStatus in a future cleanup pass once all consumers use the typed status surface.

Input

No fields besides deviceId.

Output

Where the head is pointing -- per axis, and null when the driver cannot read it.

All four said 0:

reolink return { pan: 0, tilt: 0, zoom: 0 } "until a position-query path lands upstream" hikvision stub, "firmware-dependent and frequently absent" amcrest stub, "no generic absolute-position read for this model family" onvif throws

So every consumer asking where a camera points was told "perfectly centred" by four cameras that had never looked.

There is one: PtzStatusSchema extends this, so the lie had already propagated into getStatus, which is the surface getPosition's own comment tells callers to migrate to.

FieldTypeRequiredDescription
pannumber | nullyes
tiltnumber | nullyes
zoomnumber | nullyes

setAutofocus

mutation

Toggle the camera's autofocus. Only meaningful when getOptions().hasAutofocus is true.

Input

FieldTypeRequiredDescription
enabledbooleanyes

Output

Nothing.

Actions (offered in automations and on device cards)

ActionLabelSets
ptz.autofocusOnAutofocus on
ptz.autofocusOffAutofocus off

Status

FieldTypeRequiredDescription
pannumber | nullyes
tiltnumber | nullyes
zoomnumber | nullyes
autofocusbooleanyes