Class: Ptz

Ptz()

https://www.onvif.org/specs/srv/ptz/ONVIF-PTZ-Service-Spec-v1712.pdf
https://www.onvif.org/ver20/ptz/wsdl/ptz.wsdl

Functions

Ptz#getNodes, Ptz#getNode, Ptz#getConfigurations, Ptz#getConfiguration, Ptz#getConfigurationOptions, Ptz#setConfiguration, Ptz#getCompatibleConfigurations, Ptz#absoluteMove, Ptz#relativeMove, Ptz#continuousMove, Ptz#geoMove, Ptz#stop, Ptz#getStatus, Ptz#getStatus, Ptz#setPreset, Ptz#getPresets, Ptz#gotoPreset, Ptz#removePreset, Ptz#gotoHomePosition, Ptz#setHomePosition, Ptz#sendAuxiliaryCommand

Overview

The PTZ model groups the possible movements of the PTZ unit into a Pan/Tilt component and into a Zoom component. To steer the PTZ unit, the service provides absolute move, relative move and continuous move operations. Different coordinate systems and units are used to feed these operations.
The PTZ service provides an AbsoluteMove operation to move the PTZ device to an absolute position. The service expects the absolute position as an argument referencing an absolute coordinate system. The speed of the Pan/Tilt movement and the Zoom movement can be specified optionally. Speed values are positive scalars and do not contain any directional information. It is not possible to specify speeds for Pan and Tilt separately without knowledge about the current position. This approach to specifying a desired position generally produces a non-smooth and non-intuitive action.
A RelativeMove operation is introduced by the PTZ service in order to steer the dome relative to the current position, but without the need to know the current position. The operation expects a positional translation as an argument referencing a relative coordinate system. This specification distinguishes between relative and absolute coordinate systems, since there are cases where no absolute coordinate system exists for a well-defined relative coordinate system. An optional speed argument can be added to the RelativeMove operation with the same meaning as for the AbsoluteMove operation.
Finally, the PTZ device can be moved continuously via the ContinuousMove command in a certain direction with a certain speed. Thereby, a velocity vector represents both, the direction and the speed information. The latter is expressed by the length of the vector. The Pan/Tilt and Zoom coordinates can be uniquely specified by augmenting the coordinates with appropriate space URIs. A space URI uniquely represents the underlying coordinate system. Section 5.7 defines a standard set of coordinate systems. A PTZ Node shall implement these coordinate systems if the corresponding type of movement is supported by the PTZ Node. In many cases, the Pan/Tilt position is represented by pan and tilt angles in a spherical coordinate system. A digital PTZ, operating on a fixed megapixel camera, may express the camera’s viewing direction by a pixel position on a static projection plane. Therefore, different coordinate systems are needed in this case in order to capture the physical or virtual movements of the PTZ device. Optionally, the PTZ Node may define its own device specific coordinate systems to enable clients to take advantage of the specific properties of this PTZ Node. The PTZ Node description retrieved via the GetNode or GetNodes operation contains all coordinate systems supported by a specific PTZ Node. Each coordinate system belongs to one of the following groups:
  • AbsolutePanTiltPositionSpace
  • RelativePanTiltTranslationSpace
  • ContinuousPanTiltVelocitySpace
  • PanTiltSpeedSpace
  • AbsoluteZoomPositionSpace
  • RelativeZoomTranslationSpace
  • ContinuousZoomVelocitySpace
  • ZoomSpeedSpace
If the PTZ node does not support the coordinate systems of a certain group, the corresponding move operation will not be available for this PTZ node. For instance, if the list does not contain an AbsolutePanTiltPositionSpace, the AbsoluteMove operation shall fail when an absolute Pan/Tilt position is specified. The corresponding command section describes those spaces that are required for a specific move command.

Constructor

new Ptz()

Source:

Methods

absoluteMove(profileTokenopt, position, speedopt, callbackopt)

If a PTZ node supports absolute Pan/Tilt or absolute Zoom movements, it shall support the AbsoluteMove operation. The position argument of this command specifies the absolute position to which the PTZ unit moves. It splits into an optional Pan/Tilt element and an optional Zoom element. If the Pan/Tilt position is omitted, the current Pan/Tilt movement shall NOT be affected by this command. The same holds for the zoom position.
The spaces referenced within the position shall be absolute position spaces supported by the PTZ node. If the space information is omitted, the corresponding default spaces of the PTZ configuration, a part of the specified Media Profile, is used. A device may support absolute Pan/Tilt movements, absolute Zoom movements or no absolute movements by providing only absolute position spaces for the supported cases.
An existing Speed argument overrides the DefaultSpeed of the corresponding PTZ configuration during movement to the requested position. If spaces are referenced within the Speed argument, they shall be Speed Spaces supported by the PTZ Node.
The operation shall fail if the requested absolute position is not reachable.
Parameters:
Name Type Attributes Description
profileToken string <optional>
If no profileToken is provided, then the defaultProfileToken will be used.
position object Vector specifying the absolute target position.
Properties
Name Type Attributes Description
x float <optional>
The x component corresponds to pan.
y float <optional>
The y component corresponds to tilt.
z float <optional>
A zoom position.
speed object <optional>
Speed vector specifying the velocity of pan, tilt and zoom.
Properties
Name Type Attributes Description
x float <optional>
The x component corresponds to pan. If omitted in a request, the current (if any) PanTilt movement should not be affected.
y float <optional>
The y component corresponds to tilt. If omitted in a request, the current (if any) PanTilt movement should not be affected
z float <optional>
A zoom speed. If omitted in a request, the current (if any) Zoom movement should not be affected.
callback callback <optional>
Optional callback, instead of a Promise.
Source:

continuousMove(profileTokenopt, velocity, timeoutopt, callbackopt)

A PTZ-capable device shall support continuous movements. The velocity argument of this command specifies a signed speed value for the Pan, Tilt and Zoom. The combined Pan/Tilt element is optional and the Zoom element itself is optional. If the Pan/Tilt element is omitted, the current Pan/Tilt movement shall NOT be affected by this command. The same holds for the Zoom element. The spaces referenced within the velocity element shall be velocity spaces supported by the PTZ Node. If the space information is omitted for the velocity argument, the corresponding default spaces of the PTZ configuration belonging to the specified Media Profile is used. A device MAY support continuous Pan/Tilt movements and/or continuous Zoom movements by providing only velocity spaces for the supported cases.
An existing timeout argument overrides the DefaultPTZTimeout parameter of the corresponding PTZ configuration for this Move operation. The timeout parameter specifies how long the PTZ node continues to move.
A device shall stop movement in a particular axis (Pan, Tilt, or Zoom) when zero is sent as the ContinuousMove parameter for that axis. Stopping shall have the same effect independent of the velocity space referenced. This command has the same effect on a continuous move as the stop command specified in section 5.3.5.
If the requested velocity leads to absolute positions which cannot be reached, the PTZ node shall move to a reachable position along the border of its range. A typical application of the continuous move operation is controlling PTZ via joystick.
Parameters:
Name Type Attributes Description
profileToken string <optional>
If no profileToken is provided, then the defaultProfileToken will be used.
velocity object One of PanTilt (x,y) or Zoom (z), or both, is required.
Properties
Name Type Attributes Description
x float <optional>
Pan speed.
y float <optional>
Tilt spped.
z float <optional>
Zoom speed.
timeout integer <optional>
Duration: An optional Timeout parameter.
callback callback <optional>
Optional callback, instead of a Promise.
Source:
Example
const OnvifManager = require('onvif-nvt')
OnvifManager.connect('10.10.1.60', 80, 'username', 'password')
  .then(results => {
    let camera = results
    if (camera.ptz) { // PTZ is supported on this device
      let velocity = { x: 1, y: 0 }
      camera.ptz.continuousMove(null, velocity)
        .then(() => {
          setTimeout(() => {
            camera.ptz.stop()
          }, 5000) // stop the camera after 5 seconds
        })
    }
  })

createRequest(body)

Private function for creating a SOAP request.
Parameters:
Name Type Description
body string The body of the xml.
Source:

geoMove(profileTokenopt, geoLocation, speedopt, areaWidthopt, areaHeightopt, callbackopt)

+++ This function is untested as I do not have any cameras that support this feature.
A device signaling GeoMove in one of its PTZ nodes shall support this command. The optional AreaHeight and AreaWidth parameters can be added to the request, so that the PTZ-capable device can internally determine the zoom factor. In case both AreaHeight and AreaWidth are not provided, the unit will not change the zoom. AreaHeight and AreaWidth are expressed in meters.
An existing speed argument overrides the DefaultSpeed of the corresponding PTZ configuration during movement by the requested translation. If spaces are referenced within the speed argument, they shall be speed spaces supported by the PTZ node.
If the PTZ-capable device does not support automatic retrieval of the geolocation, it shall be configured by using SetGeoLocation before it can perform geo-referenced commands. In case the client requests a GeoMove command before the geolocation of the device is configured, the device shall return an error.
Depending on the kinematics of the PTZ-capable device, the requested position may not be reachable. In this situation the device shall return an error, signalling that it cannot perform the requested action due to physical limitations.
Parameters:
Name Type Attributes Description
profileToken string <optional>
If no profileToken is provided, then the defaultProfileToken will be used.
geoLocation object Target coordinates.
Properties
Name Type Description
lon float East west location as angle.
lat float North south location as angle.
elevation float Height in meters above sea level.
speed object <optional>
Speed vector specifying the velocity of pan, tilt and zoom.
Properties
Name Type Attributes Description
x float <optional>
The x component corresponds to pan. If omitted in a request, the current (if any) PanTilt movement should not be affected.
y float <optional>
The y component corresponds to tilt. If omitted in a request, the current (if any) PanTilt movement should not be affected
z float <optional>
A zoom speed. If omitted in a request, the current (if any) Zoom movement should not be affected.
areaWidth float <optional>
Optional area to be shown.
areaHeight float <optional>
Optional area to be shown.
callback callback <optional>
Optional callback, instead of a Promise.
Source:

getCompatibleConfigurations(profileTokenopt, callbackopt)

A device signalling support for GetCompatibleConfigurations via the capability GetCompatibleConfigurations shall return all available PTZConfigurations that can be added to the referenced media profile through the GetComatibleConfigurations operation.
A device providing more than one PTZConfiguration or more than one VideoSourceConfiguration or which has any other resource interdependency between PTZConfiguration entities and other resources listable in a media profile should implement this operation. PTZConfiguration entities returned by this operation shall not fail on adding them to the referenced media profile.
Parameters:
Name Type Attributes Description
profileToken string <optional>
If no profileToken is provided, then the defaultProfileToken will be used.
callback callback <optional>
Optional callback, instead of a Promise.
Source:

getConfiguration(configurationToken, callbackopt)

A PTZ-capable device shall implement the GetConfigurationOptions operation. It returns the list of supported coordinate systems including their range limitations. Therefore, the options MAY differ depending on whether the PTZ configuration is assigned to a profile(see ONVIF Media Service Specification) containing a VideoSourceConfiguration. In that case, the options may additionally contain coordinate systems referring to the image coordinate system described by the VideoSourceConfiguration. Each listed coordinate system belongs to one of the groups listed in Section 4. If the PTZ node supports continuous movements, it shall return a timeout range within which timeouts are accepted by the PTZ node.
Parameters:
Name Type Attributes Description
configurationToken string Reference to the requested PTZ configuration.
callback callback <optional>
Optional callback, instead of a Promise.
Source:

getConfigurationOptions(configurationToken, callbackopt)

A PTZ-capable device shall implement the GetConfigurationOptions operation. It returns the list of supported coordinate systems including their range limitations. Therefore, the options MAY differ depending on whether the PTZ configuration is assigned to a profile(see ONVIF Media Service Specification) containing a VideoSourceConfiguration. In that case, the options may additionally contain coordinate systems referring to the image coordinate system described by the VideoSourceConfiguration. Each listed coordinate system belongs to one of the groups listed in Section 4. If the PTZ node supports continuous movements, it shall return a timeout range within which timeouts are accepted by the PTZ node.
Parameters:
Name Type Attributes Description
configurationToken string Reference to the requested PTZ configuration.
callback callback <optional>
Optional callback, instead of a Promise.
Source:

getConfigurations(callbackopt)

The PTZConfiguration contains a reference to the PTZ node in which it belongs. This reference cannot be changed by a client.
The following elements are part of the PTZ Configuration:
  • PTZNodeToken – A mandatory reference to the PTZ node that the PTZ Configuration belongs to.
  • DefaultAbsolutePanTiltPositionSpace – If the PTZ node supports absolute Pan/Tilt movements, it shall specify one Absolute Pan/Tilt Position Space as default.
  • DefaultRelativePanTiltTranslationSpace – If the PTZ node supports relative Pan/Tilt movements, it shall specify one RelativePan/Tilt Translation Space as default.
  • DefaultContinuousPanTiltVelocitySpace – If the PTZ node supports continuous Pan/Tilt movements, it shall specify one continuous Pan/Tilt velocity space as default.
  • DefaultPanTiltSpeedSpace – If the PTZ node supports absolute or relative movements, it shall specify one Pan/Tilt speed space as default.
  • DefaultAbsoluteZoomPositionSpace – If the PTZ node supports absolute zoom movements, it shall specify one absolute zoom position space as default.
  • DefaultRelativeZoomTranslationSpace – If the PTZ node supports relative zoom movements, it shall specify one relative zoom translation space as default.
  • DefaultContinuousZoomVelocitySpace – If the PTZ node supports continuous zoom movements, it shall specify one continuous zoom velocity space as default.
  • DefaultPTZSpeed – If the PTZ node supports absolute or relative PTZ movements, it shall specify corresponding default Pan/Tilt and Zoom speeds.
  • DefaultPTZTimeout – If the PTZ node supports continuous movements, it shall specify a default timeout, after which the movement stops.
  • PanTiltLimits – The Pan/Tilt limits element should be present for a PTZ node that supports an absolute Pan/Tilt. If the element is present it signals the support for configurable Pan/Tilt limits. If limits are enabled, the Pan/Tilt movements shall always stay within the specified range. The Pan/Tilt limits are disabled by setting the limits to –INF or +INF.
  • ZoomLimits – The zoom limits element should be present for a PTZ node that supports absolute zoom. If the element is present it signals the supports for configurable zoom limits. If limits are enabled the zoom movements shall always stay within the specified range. The Zoom limits are disabled by settings the limits to –INF and +INF.
  • MoveRamp – The optional acceleration ramp used by the device when moving.
  • PresetRamp – The optional acceleration ramp used by the device when recalling presets.
  • PresetTourRamp – The optional acceleration ramp used by the device when executing PresetTours.
The default position/translation/velocity spaces are introduced to allow clients sending move requests without the need to specify a certain coordinate system. The default speeds are introduced to control the speed of move requests (absolute, relative, preset), where no explicit speed has been set.
The allowed pan and tilt range for Pan/Tilt limits is defined by a two-dimensional space range that is mapped to a specific absolute Pan/Tilt position space. At least one Pan/Tilt position space is required by the PTZNode to support Pan/Tilt limits. The limits apply to all supported absolute, relative and continuous Pan/Tilt movements. The limits shall be checked within the coordinate system for which the limits have been specified. That means that even if movements are specified in a different coordinate system, the requested movements shall be transformed to the coordinate system of the limits where the limits can be checked. When a relative or continuous movements is specified, which would leave the specified limits, the PTZ unit has to move along the specified limits. The Zoom Limits have to be interpreted accordingly.
Parameters:
Name Type Attributes Description
callback callback <optional>
Optional callback, instead of a Promise.
Source:

getNode(nodeToken, callbackopt)

A PTZ-capable device shall implement the GetNode operation and return the properties of the requested PTZ node, if it exists. Otherwise, the device shall respond with an appropriate fault message.
Parameters:
Name Type Attributes Description
nodeToken * Reference to the requested PTZNode.
callback callback <optional>
Optional callback, instead of a Promise.
Source:

getNodes(callbackopt)

A PTZ-capable device shall implement this operation and return all PTZ nodes available on the device.
Parameters:
Name Type Attributes Description
callback callback <optional>
Optional callback, instead of a Promise.
Source:

getPresets(profileTokenopt, callbackopt)

The GetPresets operation returns the saved presets consisting of the following elements:
  • Token – A unique identifier to reference the preset.
  • Name – An optional mnemonic name.
  • PTZ Position – An optional absolute position. If the PTZ node supports absolute Pan/Tilt position spaces, the Pan/Tilt position shall be specified. If the PTZ node supports absolute zoom position spaces, the zoom position shall be specified.
.
Parameters:
Name Type Attributes Description
profileToken string <optional>
If no profileToken is provided, then the defaultProfileToken will be used.
callback callback <optional>
Optional callback, instead of a Promise.
Source:

getStatus(profileTokenopt, callbackopt)

A PTZ-capable device shall be able to report its PTZ status through the GetStatus command. The PTZ status contains the following information:
  • Position (optional) – Specifies the absolute position of the PTZ unit together with the space references. The default absolute spaces of the corresponding PTZ configuration shall be referenced within the position element. This information shall be present if the device signals support via the capability StatusPosition.
  • MoveStatus (optional) – Indicates if the Pan/Tilt/Zoom device unit is currently moving, idle or in an unknown state. This information shall be present if the device signals support via the capability MoveStatus. The state Unknown shall not be used during normal operation, but is reserved to initialization or error conditions.
  • Error (optional) – States a current PTZ error condition. This field shall be present if the MoveStatus signals Unknown.
  • UTC Time – Specifies the UTC time when this status was generated.
.
Parameters:
Name Type Attributes Description
profileToken string <optional>
If no profileToken is provided, then the defaultProfileToken will be used.
callback callback <optional>
Optional callback, instead of a Promise.
Source:

gotoHomePosition(profileTokenopt, speedopt, callbackopt)

This operation moves the PTZ unit to its home position. If the speed parameter is omitted, the default speed of the corresponding PTZ configuration shall be used. The speed parameter can only be specified when speed spaces are available for the PTZ node.The command is nonblocking and can be interrupted by other move commands.
Parameters:
Name Type Attributes Description
profileToken string <optional>
If no profileToken is provided, then the defaultProfileToken will be used.
speed object <optional>
Speed vector specifying the velocity of pan, tilt and zoom.
Properties
Name Type Attributes Description
x float <optional>
The x component corresponds to pan. If omitted in a request, the current (if any) PanTilt movement should not be affected.
y float <optional>
The y component corresponds to tilt. If omitted in a request, the current (if any) PanTilt movement should not be affected
z float <optional>
A zoom speed. If omitted in a request, the current (if any) Zoom movement should not be affected.
callback callback <optional>
Optional callback, instead of a Promise.
Source:

gotoPreset(profileTokenopt, presetToken, speedopt, callbackopt)

The GotoPreset operation recalls a previously set preset. If the speed parameter is omitted, the default speed of the corresponding PTZ configuration shall be used. The speed parameter can only be specified when speed spaces are available for the PTZ node. The GotoPreset command is a non-blocking operation and can be interrupted by other move commands.
Parameters:
Name Type Attributes Description
profileToken string <optional>
If no profileToken is provided, then the defaultProfileToken will be used.
presetToken string Reference to an existing preset token.
speed object <optional>
Speed vector specifying the velocity of pan, tilt and zoom.
Properties
Name Type Attributes Description
x float <optional>
The x component corresponds to pan. If omitted in a request, the current (if any) PanTilt movement should not be affected.
y float <optional>
The y component corresponds to tilt. If omitted in a request, the current (if any) PanTilt movement should not be affected
z float <optional>
A zoom speed. If omitted in a request, the current (if any) Zoom movement should not be affected.
callback callback <optional>
Optional callback, instead of a Promise.
Source:

init(timeDiff, serviceAddress, usernameopt, passwordopt)

Call this function directly after instantiating a Ptz object.
Parameters:
Name Type Attributes Description
timeDiff number The onvif device's time difference.
serviceAddress object An url object from url package - require('url').
username string <optional>
Optional only if the device does NOT have a user.
password string <optional>
Optional only if the device does NOT have a password.
Source:

panTiltZoomOptions(vectors)

Used internally. Creates xml where PanTilt (x|y) and Zoom (z) are needed.
Parameters:
Name Type Description
vectors object One of PanTilt (x,y) or Zoom (z), or both, is required.
Properties
Name Type Attributes Description
x object <optional>
The x component corresponds to pan.
y object <optional>
The y component corresponds to tilt.
z object <optional>
The z component corresponds to zoom.
Source:

relativeMove(profileTokenopt, translation, speedopt, callbackopt)

If a PTZ node supports relative Pan/Tilt or relative Zoom movements, then it shall support the RelativeMove operation. The translation argument of this operation specifies the difference from the current position to the position to which the PTZ device is instructed to move. The operation is split into an optional Pan/Tilt element and an optional Zoom element. If the Pan/Tilt element is omitted, the current Pan/Tilt movement shall NOT be affected by this command. The same holds for the zoom element.
The spaces referenced within the translation element shall be translation spaces supported by the PTZ node. If the space information is omitted for the translation argument, the corresponding default spaces of the PTZ configuration, which is part of the specified Media Profile, is used. A device may support relative Pan/Tilt movements, relative Zoom movements or no relative movements by providing only translation spaces for the supported cases. An existing speed argument overrides the DefaultSpeed of the corresponding PTZ configuration during movement by the requested translation. If spaces are referenced within the speed argument, they shall be speed spaces supported by the PTZ node.
The command can be used to stop the PTZ unit at its current position by sending zero values for Pan/Tilt and Zoom. Stopping shall have the very same effect independent of the relative space referenced.
If the requested translation leads to an absolute position which cannot be reached, the PTZ Node shall move to a reachable position along the border of valid positions.
Parameters:
Name Type Attributes Description
profileToken string <optional>
If no profileToken is provided, then the defaultProfileToken will be used.
translation object Vector specifying the positional Translation relative to the current position.
Properties
Name Type Attributes Description
x float <optional>
The x component corresponds to pan.
y float <optional>
The y component corresponds to tilt.
z float <optional>
A zoom position.
speed object <optional>
Speed vector specifying the velocity of pan, tilt and zoom.
Properties
Name Type Attributes Description
x float <optional>
The x component corresponds to pan. If omitted in a request, the current (if any) PanTilt movement should not be affected.
y float <optional>
The y component corresponds to tilt. If omitted in a request, the current (if any) PanTilt movement should not be affected
z float <optional>
A zoom speed. If omitted in a request, the current (if any) Zoom movement should not be affected.
callback callback <optional>
Optional callback, instead of a Promise.
Source:

removePreset(profileTokenopt, presetToken, callbackopt)

The RemovePreset operation removes a previously set preset.
Parameters:
Name Type Attributes Description
profileToken string <optional>
If no profileToken is provided, then the defaultProfileToken will be used.
presetToken string Existing preset token to be removed.
callback callback <optional>
Optional callback, instead of a Promise.
Source:

sendAuxiliaryCommand(profileTokenopt, auxiliaryData, callbackopt)

This operation is used to call an auxiliary operation on the device. The supported commands can be retrieved via the PTZ node properties. The AuxiliaryCommand should match the supported command listed in the PTZ node; no other syntax is supported. If the PTZ node lists the tt:IRLamp command, then the parameter of AuxiliaryCommand command shall conform to the syntax specified in Section 8.6 Auxiliary operation of ONVIF Core Specification. The SendAuxiliaryCommand shall be implemented when the PTZ node supports auxiliary commands.
Parameters:
Name Type Attributes Description
profileToken string <optional>
If no profileToken is provided, then the defaultProfileToken will be used.
auxiliaryData string Auxiliary command to be applied.
callback callback <optional>
Optional callback, instead of a Promise.
Source:

setConfiguration(configurationToken, ptzConfigurationOptions, forcePersistence, callbackopt)

+++ TODO: This function is incomplete and requires a LOT of work for little return.
+++ Alternatively, you can pass XML in for ptzConfigurationOptions in the desired
+++ way required by the spec, in which case the function will work.
A PTZ-capable device shall implement the SetConfiguration operation. The ForcePersistence flag indicates if the changes remain after reboot of the device.
Parameters:
Name Type Attributes Description
configurationToken string Reference to the PTZ configuration to be modified.
ptzConfigurationOptions xml The requested PTZ node configuration options.
forcePersistence boolean Deprecated modifier for temporary settings if supported by the device.
callback callback <optional>
Optional callback, instead of a Promise.
Source:

setDefaultProfileToken(profileToken)

Sets the default profile token. This comes from media#getProfiles method.
By default, this module will get the first Profile and use it as the default profile. You can change the default profile by setting this function. Note: This functionality is only used where API calls require a ProfileToken and one is not provided.
Parameters:
Name Type Description
profileToken string The profileToken to use when one is not passed to a method requiring one.
Source:

setHomePosition(profileTokenopt, callbackopt)

The SetHome operation saves the current position parameters as the home position, so that the GotoHome operation can request that the device move to the home position.
The SetHomePosition command shall return with a failure if the “home” position is fixed and cannot be overwritten. If the SetHomePosition is successful, it shall be possible to recall the home position with the GotoHomePosition command.
Parameters:
Name Type Attributes Description
profileToken string <optional>
If no profileToken is provided, then the defaultProfileToken will be used.
callback callback <optional>
Optional callback, instead of a Promise.
Source:

setPreset(profileTokenopt, presetTokenopt, presetNameopt, callbackopt)

The SetPreset command saves the current device position parameters so that the device can move to the saved preset position through the GotoPreset operation.
If the PresetToken parameter is absent, the device shall create a new preset. Otherwise it shall update the stored position and optionally the name of the given preset. If creation is successful, the response contains the PresetToken which uniquely identifies the preset. An existing preset can be overwritten by specifying the PresetToken of the corresponding preset. In both cases (overwriting or creation) an optional PresetName can be specified. The operation fails if the PTZ device is moving during the SetPreset operation.
The device MAY internally save additional states such as imaging properties in the PTZ preset which then should be recalled in the GotoPreset operation. A device shall accept a valid SetPresetRequest that does not include the optional element PresetName. Devices may require unique preset names and reject a request that contains an already existing PresetName by responding with the error message ter:PresetExist.
Parameters:
Name Type Attributes Description
profileToken string <optional>
If no profileToken is provided, then the defaultProfileToken will be used.
presetToken string <optional>
Optional existing preset token to update a preset position.
presetName string <optional>
Optional name to be assigned to the preset position.
callback callback <optional>
Optional callback, instead of a Promise.
Source:

stop(profileTokenopt, panTiltopt, zoomopt, callbackopt)

A PTZ-capable device shall support the stop operation. If no stop filter arguments are present, this command stops all ongoing pan, tilt and zoom movements. The stop operation can be filtered to stop a specific movement by setting the corresponding stop argument.
Parameters:
Name Type Attributes Description
profileToken string <optional>
If no profileToken is provided, then the defaultProfileToken will be used.
panTilt boolean <optional>
Defaults to true..........
zoom boolean <optional>
Defaults to true
callback callback <optional>
Optional callback, instead of a Promise.
Source: