Alarm & Deterrence
Pre-requisite: The user has to be signed in to perform the following operations.
The controls that make a camera do something about an intruder rather than just record one: a siren the user can trigger from live view, lights the camera can switch on, and the zones that decide which movement counts. Which of these a camera has is advertised through its clusters — check the supports… flags on CameraClustersModel before showing a control.
Manual Siren
If the camera supports the manual siren (supportsManualSiren), it can be started and stopped over the data channel of a running live view stream. The camera should already be streaming live view before making these calls.
liveViewObject.startManualSiren()
liveViewObject.stopManualSiren()
startManualSiren() pulses the siren in 3-second bursts and keeps re-sending until stopManualSiren() is called (stop is deferred so the siren runs at least ~1 s); if the app stops without calling it, the siren ends within 3 s. The SDK does not check that the data channel is open before sending — gate the button on isDataChannelOpen / onDataChannelOpen, or the command is silently lost.
The manualSiren cluster (supportsManualSiren) is what advertises the feature; the SDK only reads it as a capability flag.
Alarm Light and Flood Light
Cameras with a light advertise one of two clusters, each with a single attribute:
| Cluster | Attribute | Capability flag |
|---|---|---|
ClustersType.alarmLight | ClustersAttribute.alarmLight | supportsAlarmLight |
ClustersType.floodLight | ClustersAttribute.fldLtMode | supportsFloodLight |
alarmLight is a Bool (clusters.alarmLightMode). fldLtMode is an enum (clusters.floodLightMode: String?); the options a camera offers are in clusters.floodLightModeOptionsList, and the value to write is a DisplayLabel.enumValue. Write either with updateDeviceClustersAttribute, using the ids the enums expose:
let mode = clusters.floodLightModeOptionsList?.first // pick from the list the camera reports
Factory.deviceService.updateDeviceClustersAttribute(
spaceId: spaceId,
deviceId: deviceId,
clusterId: ClustersType.floodLight.clusterId,
attributeId: ClustersAttribute.fldLtMode.attributeId,
wakeup: device.isMcuSupported,
request: UpdateClusterAttributeRequestModel(value: .string(mode!.enumValue))
)
The spot light on a camera light (supportsSpotLight, attribute ltMode, values SpotLightMode: Intel, IR, CLR, Off; options in clusters.cameraLightOptionsList) is a plain camera light rather than a deterrent; the on/off switch is Toggle Device Spotlight.
Activity Zones
An activity zone limits detection to part of the frame. Cameras advertise the activityZone cluster (supportsActivityZone); radar-equipped cameras advertise radarZone (supportsRadarZone) instead. CameraClustersModel decodes both:
clusters.getActivityZones() -> [Int]
clusters.getRadarDetectionZoneSegments() -> [Int]
clusters.getRadarDetectionZoneLevel() -> String?
To read the zones of every camera enrolled in professional monitoring in one call, The following method can be used. ActivityZoneModel splits them into nonClusterDevices ([ActivityZoneDevice]) and clusterDevices ([Cluster]):
spaceId(required): The space ID of the devices.
Factory.deviceService.getProSecurityProfileDevicesActivityZone(spaceId: String) -> IVPublisher<ActivityZoneModel>
Security State
A camera that takes part in professional monitoring exposes a securityState cluster (supportsSecurityState) carrying armID, exitDelay and securityState. It reflects the system state set through System Control; read it rather than writing it.
Pro Monitoring Support
Pro Monitoring is supported only for cameras with product_type set to HomeSecurity. Doorbell cameras are excluded from Pro Monitoring support, even if they belong to the HomeSecurity product category.