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…() helpers on DeviceCluster (from getDeviceCluster) before showing a control; only supportsManualSiren() is also available directly on Device.


Manual Siren

If the camera supports the manual siren (device.supportsManualSiren(), cluster DeviceClusterTypes.ManualSiren), it can be started and stopped over the data channel of a running LiveStreamClient. The stream should already be started.

Note: The siren works with press-and-hold — call startSiren() on press and stopSiren() on release.

client.startSiren() // Starts the siren
client.stopSiren()  // Stops the siren

startSiren() repeats a 3-second siren command every 3 s until stopSiren() is called, and suspends the live view’s auto-disconnect while it runs — always call stopSiren() on release so auto-disconnect is restored. The SDK silently drops the command if the data channel is not yet open (no error is reported); gate the button on client.status being StreamStatus.STARTED, which is emitted once the first frame renders.


Alarm Light, Flood Light and Guide Lamp

Cameras with a light advertise one of these clusters. Read the current mode and the options the camera offers from DeviceCluster, and write with updateClusterAttribute — see Device Clusters.

Cluster (DeviceClusterTypes) Attribute (ClusterAttributeTypes) Read Options / values Capability
AlarmLight (0xFC17) AlarmLightMode (0xFC17:0x00) alarmLightMode(): Boolean on / off supportsAlarmLight()
FloodLight (0xFC18) FloodLightMode (0xFC18:0x00) floodLightMode(): String, floodLightModeOptions() FloodLightMode: Intel, IR, CLR, Off supportsFloodLight()
GuideLamp (0xFC16) GuideLampMode (0xFC16:0x00) guideLightMode(): String, guideLightModeOptions() GuideLightMode: Intel, Off, CLR supportsGuideLamp()
InstaVision.deviceServices.updateClusterAttribute(
  device = device,
  clusterId = DeviceClusterTypes.FloodLight.id,
  attributeId = ClusterAttributeTypes.FloodLightMode.id,
  request = UpdateClusterAttributeRequest(value = FloodLightMode.CLR.name),
  onSuccess = { },
  onError = { error -> }
)

The camera’s spotlight (CameraLight cluster, LightMode) is a plain light rather than a deterrent — see Device Configuration.


Activity and Radar Zones

An activity zone limits detection to part of the frame (BlockActivityZone cluster, supportsActivityZone(), isActivityZoneEnabled(), activityZones(), getActivityZoneConfig()); radar-equipped cameras use RadarDetection instead (supportsRadarDetection(), radarProperties()).

To read the zones of every device in the space in one call — cluster and non-cluster devices are returned separately — The following method can be used:

  • spaceId (required): The space ID of the devices.
InstaVision.deviceServices.getActivityZones(
  spaceId = "spaceId",
  onSuccess = { activityZones ->
    // Cluster and non-cluster devices with their zones
  },
  onError = { error -> }
)

This site uses Just the Docs, a documentation theme for Jekyll.