Alexa.EventDetectionSensor Interface
Support the Alexa.EventDetectionSensor
interface so that your camera devices can notify Alexa when they detect the presence of a person. When your camera detects a person, you report that information to Alexa in a change report, and Alexa notifies your user. Users can set up notifications and routines for person detection in the Alexa app. By setting up person detection, users can reduce the number of notifications they receive when tracking all motion detection.
You can also support the Alexa.MediaMetadata Interface to enable Alexa to search and display the media clip of the person that is detected. Users can ask Alexa questions like "Alexa, show the last person detected at my front door."
Utterances
When you use the Alexa.EventDetectionSensor
and Alexa.MediaMetadata
interfaces, the voice interaction model is already built for you. The following examples show some customer utterances:
Alexa, show me the last time someone was at the front door.
Alexa, show me the last time a person was detected at the front door.
Alexa, show me the last person detected at the front door.
Alexa, show me the most recent person at the front door.
After the customer says one of these utterances, Alexa displays the media clip identified in the most recent change report sent by your skill.
Properties
The Alexa.EventDetectionSensor
interface uses the humanPresenceDetectionState
object as the primary data object.
Human presence detection state details
Field | Description | Type | Required |
---|---|---|---|
value |
Whether presence is detected or not; DETECTED or NOT_DETECTED . |
String | Yes |
detectionMethods |
The methods that the endpoint used to detect an event; AUDIO , VIDEO . |
Array | No |
media |
The identifier of the audio or video recorded for the detection event. | String | No |
humanPresenceDetectionState example
{
"value": "DETECTED",
"detectionMethods": ["VIDEO"],
"media": {
"type": "ALEXA.MEDIAMETADATA",
"id": "<media metadata id>"
}
}
Discovery
You describe endpoints that support Alexa.EventDetectionSensor
using the standard discovery mechanism described in Alexa.Discovery.
Discovery payload details
Property | Description | Support required |
---|---|---|
humanPresenceDetectionState |
Indicates whether event detection is reported for human presence. | No |
Configuration | Description | Type | Required |
---|---|---|---|
detectionMethods |
The methods that the endpoint uses to detect events; AUDIO , VIDEO . The default value is ["AUDIO", "VIDEO"] . |
Array | No |
detectionModes |
The types of events that the endpoint detects. If you don't specify detectionModes , the default is humanPresence . |
Array | No |
detectionModes. humanPresence. featureAvailability |
Indicates whether the human presence detection feature is available. The default value is ENABLED . |
A feature availability value. | No |
detectionModes. humanPresence. supportsNotDetected |
Indicates whether the endpoint supports the NOT_DETECTED state. The default value is true . |
Boolean | No |
Discovery example
The following example shows a Discover.Response
message for a camera endpoint that supports Alexa.EventDetectionSensor
and Alexa.MediaMetadata
.
{
"event": {
"header": {
"namespace": "Alexa.Discovery",
"name": "Discover.Response",
"payloadVersion": "3",
"messageId": "<message id>"
},
"payload": {
"endpoints":[
{
"endpointId": "<unique ID of the endpoint>",
"manufacturerName": "<the manufacturer name of the endpoint>",
"modelName": "<the model name of the endpoint>",
"friendlyName": "<device name, displayed in the Alexa app>",
"description": "<a description that is shown in the Alexa app>",
"displayCategories": ["CAMERA"],
"cookie": {},
"capabilities": [
{
"type": "AlexaInterface",
"interface": "Alexa.EventDetectionSensor",
"version": "3",
"properties": {
"supported": [
{
"name": "humanPresenceDetectionState"
}
],
"proactivelyReported": true,
"retrievable": false
},
"configuration": {
"detectionMethods": ["AUDIO", "VIDEO"],
"detectionModes": {
"humanPresence": {
"featureAvailability": "ENABLED",
"supportsNotDetected": false
}
}
}
},
{
"type": "AlexaInterface",
"interface": "Alexa.MediaMetadata",
"version": "3",
"proactivelyReported": true
}
]
}
]
}
}
}
AddOrUpdateReport
You must proactively send an Alexa.Discovery.AddOrUpdateReport
message if the feature support of your endpoint changes. For example, if human presence detection requires a subscription, your first discovery response indicates that the human presence detection feature is disabled. If the user buys a subscription, send an AddOrUpdateReport
message to indicate that the human presence detection feature is now enabled. Also send an AddOrUpdateReport
message if the user manually disables human presence detection. For more information, see AddOrUpdateReport.
Change report
You send a ChangeReport
event to proactively report changes in the state of an endpoint. You identify the properties that you proactively report in your discovery response. For more information about change reports, see Understand State Reporting.
ChangeReport event with person detected example
The following example shows a change report that you send when you detect a human presence.
{
"event": {
"header": {
"namespace": "Alexa",
"name": "ChangeReport",
"messageId": "<message id>",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "<an OAuth2 bearer token>"
},
"endpointId": "<endpoint id>"
},
"payload": {
"change": {
"cause": {
"type": "PHYSICAL_INTERACTION"
},
"properties": [
{
"namespace": "Alexa.EventDetectionSensor",
"name": "humanPresenceDetectionState",
"value": {
"value": "DETECTED",
"detectionMethods": ["VIDEO"],
"media": {
"type": "ALEXA.MEDIAMETADATA",
"id": "<media metadata id>"
}
},
"timeOfSample": "2017-02-03T16:20:50.52Z",
"uncertaintyInMilliseconds": 0
}
]
}
}
},
"context": {}
}