Doorbell
Pre-requisite: The user has to be signed in to perform the following operations.
A doorbell is a camera whose deviceType string is DeviceType.doorbell.rawValue ("Doorbell") — DeviceType(rawValue: device.deviceType ?? "") == .doorbell. Everything a normal camera does applies; three things are extra.
Ring Events
A press raises an event tagged EventTag.doorbellRing ("DoorbellPress"). It arrives in the event feed like any other event, and as a push notification unless doorbellMute is set:
Factory.deviceService.updateDeviceCloudNotificationsSettings(
spaceId: spaceId,
deviceId: deviceId,
wakeup: false,
request: NotificationSettingsRequest(doorbellMute: true)
)
Chime
Doorbells that support a chime advertise the chimeType cluster (0xFC22, supportsChime). It has two attributes:
| Attribute | Id | Type | Values |
|---|---|---|---|
Chime sound — ClustersAttribute.chimeSettings | 0xFC22:0x00 | enum | DoorbellChimeType: defaultType (Default), mechanicalType (Mechanical), electronicType (Electronic); default Default |
| Chime duration | 0xFC22:0x01 | value | 0–10 seconds, step 1, default 3; optional — not every model reports it |
Both are writable. Set the sound with the enum value — DoorbellChimeType.mechanicalType.rawValue — not the display label (clusters.chimeTypeOptionsList gives the DisplayLabels the camera reports, each with an enumValue and a label); the duration is an integer:
Factory.deviceService.updateDeviceCluster(
spaceId: spaceId,
deviceId: deviceId,
clusterId: ClustersType.chimeType.clusterId,
wakeup: false,
request: UpdateClusterMultipleAttributeRequestModel(attributes: [
UpdateClusterAttributeRequestModel(value: .string(DoorbellChimeType.mechanicalType.rawValue), attributeId: ClustersAttribute.chimeSettings.attributeId),
UpdateClusterAttributeRequestModel(value: .int(5), attributeId: "0xFC22:0x01")
])
)
The duration attribute has no ClustersAttribute case in IVSDK 3.0.1, so it is addressed by its raw id. Check the cluster the camera returns before writing it — it is optional.
Answering the Door
Answering is a two-way call: open live view with supportsCalling, register the call with createTwoWayCallEvent, and pass its id to the camera. The full sequence — accept, disconnect, local video, reporting the outcome — is on Two-Way Calling. Cameras that can take a call advertise the videoCall cluster (supportsVideoCall).