CameraClipPreview Schema
Nest Doorbell (battery)
sdm.devices.traits.CameraClipPreview
This trait belongs to any device that supports the download of a clip preview.
Fields
There are no fields available for this trait.
Commands
There are no commands available for this trait.
Events
ClipPreview
A video clip is available for preview.
A clip preview is a 10 frame video file in mp4 format. You can choose to show the mp4 video file, or transcode it to another format (for example, an animated gif) in order to show a complete 10 frame sequence. The device client capabilities should be considered when selecting a clip preview method.
This event is supported for the following events:
Type | Element | Description |
---|---|---|
Event | Motion event of the CameraMotion trait | Motion has been detected by the camera. |
Event | Person event of the CameraPerson trait | A person has been detected by the camera. |
Event | Chime event of the DoorbellChime trait | The doorbell has been pressed. |
eventSessionId
to associate this event and the related previewUrl
with one or more supported events.
ClipPreview event
Payload
{ "eventId" : "493fce3f-9509-4c62-8bc0-c3c20cb35db7",
"timestamp" : "2019-01-01T00:00:01Z",
"resourceUpdate" : { "name" : "enterprises/project-id/devices/device-id", "events" : { "sdm.devices.events.CameraClipPreview.ClipPreview
" : { "eventSessionId" : "CjY5Y3VKaTZwR3o4Y19YbTVfMF...", "previewUrl" : "https://previewUrl/..." } } } "userId" : "AVPHwEuBfnPOnTqzVFT4IONX2Qqhu9EJ4ubO-bNnQ-yi",
"resourceGroup" : [ "enterprises/project-id/devices/device-id" ] }
ClipPreview event fields
Field | Description | Data Type |
---|---|---|
eventSessionId |
An ID given to events occurring as part of a single session of related events. May be used for consolidating events. | string Example: "CjY5Y3VKaTZwR3o4Y19YbTVfMF..." |
previewUrl |
The URL at which to preview the video clip. The default video codec is H264. | string Example: "https://previewUrl/..." |
Event payload fields
Field | Description | Data Type |
---|---|---|
eventId |
The unique identifier for the event. | string Example: "493fce3f-9509-4c62-8bc0-c3c20cb35db7" |
timestamp |
The time when the event occurred. | string Example: "2019-01-01T00:00:01Z" |
resourceUpdate |
An object that details information about the resource update. | object |
userId |
A unique, obfuscated identifier that represents the user. | string Example: "AVPHwEuBfnPOnTqzVFT4IONX2Qqhu9EJ4ubO-bNnQ-yi" |
resourceGroup |
An object that indicates resources that might have similar updates to this event. The resource of the event itself (from the resourceUpdate object) will always be present in this object. |
object |
See Events for more information on the different types of events and how they work.
Preview the clip
To preview the clip, make a GET call to the previewUrl
using the OAuth access token in the HTTP Authorization header:
Preview
curl -H 'Authorization: Bearer access-token' \
https://previewUrl/...
Errors
See the API Error Code Reference for the full list of API error codes.