Device Cloud Settings
Pre-requisite: The user has to be signed in to perform the following operations.
Get Cloud settings for a device
To get the cloud settings for a device, The following method can be used:
device(required): The device object on which the operation has to be performed.
InstaVision.deviceServices.getCloudSettings(
device = device,
onSuccess = { cloudSetting ->
// The cloud settings object
},
onError = { error ->
// The error object contains the error code and message
},
)
Update AI cloud settings for a device
To update the AI cloud settings for a device, The following method can be used:
device(required): The device object on which the operation has to be performed.request(required): The request object containing the AI cloud settings to be updated.
val request = AiSettingsRequest(cloudAi = AiDetection(motion = true)) // or edgeAi = AiDetection(...) for on-camera detection
InstaVision.deviceServices.updateAiSettings(
device = device,
request = request,
onSuccess = {
// The cloud settings updated
},
onError = { error ->
// The error object contains the error code and message
},
)
Update Notification cloud Settings for a Device
To update the notification cloud settings for a device, The following method can be used:
device(required): The device object on which the operation has to be performed.request(required): The request object containing the notification cloud settings to be updated.
val status = false // current mute state
val request = Notification(mute = !status)
InstaVision.deviceServices.updateNotificationSettings(
device = device,
request = request,
onSuccess = {
// The notification settings updated
},
onError = { error ->
// The error object contains the error code and message
},
)
Get Activity Zones all the devices in a space
To get the activity zones for all the devices in a space, The following method can be used:
spaceId(required): The space ID of the devices.
InstaVision.deviceServices.getActivityZones(
spaceId = "spaceId",
onSuccess = { activityZones ->
// An object containing the activity zones for all devices in the space including cluster and non-cluster devices
},
onError = { error ->
// The error object contains the error code and message
},
)
Update Motion Detection Settings for a Device
A convenience for updateAiSettings(AiSettingsRequest(cloudAi = AiDetection(motion = isEnabled))) — it toggles the cloud motion-detection flag. For the on-camera MotionDetection cluster use updateClusterAttribute with DeviceClusterTypes.MotionDetection / ClusterAttributeTypes.MotionDetection.
device(required): The device object on which the operation has to be performed.isEnabled(required): A boolean value indicating whether motion detection should be enabled or disabled.
InstaVision.deviceServices.updateMotionDetection(
device = device,
isEnabled = true, // Set to false to disable motion detection
onSuccess = {
// The motion detection settings have been updated successfully
},
onError = { error ->
// The error object contains the error code and message
},
)
AiDetection carries one flag per detection type. Which flags a camera honours depends on its product line:
| Product | Detection flags (AiDetection) | Notification flags (Notification) |
|---|---|---|
| All | motion, person, vehicle, animal | mute, cameraOfflineNotification, callMute |
| Home Security | — | doorbellMute |
| Baby | cry | cryMute, temperatureMute, humidityMute |
| Pet | pet | — |
| Bird | bird | birdNotification.birdDetectionMute / .birdIdentificationMute |
| Trail | wildlife | — |
Embargo and hunting mode are documented with Trail.