Connect a Camera to Alexa

The following shows an example of how to use the capability interfaces to connect a camera to Alexa.

Capabilities

The camera declares the following capabilities.

Capability Purpose Example utterance

MediaMetadata

Allows a customer to view and manage recordings.

"Show the last activity at my front porch"

CameraStreamController

Allows a customer to view the live video feed from the camera.

"Show the front porch"

EndpointHealth

Enables in-depth reporting of the state of the device to the customer through experiences like the Alexa app.

Not applicable.

Alexa

Contains directives and events related to state and error reporting. Make sure to explicitly include this interface and the supported version in the discovery response.

Not applicable.

Discovery

The camera provides the following AddOrUpdateReport.

{
  "event": {
    "header": {
      "namespace": "Alexa.Discovery",
      "name": "AddOrUpdateReport",
      "payloadVersion": "3",
      "messageId": "00000000-0000-0000-0000-000000000000"
    },
    "payload": {
      "endpoints": [
        {
          "endpointId": "appliance-001",
          "friendlyName": "Front Porch",
          "description": "Camera by Sample Manufacturer",
          "manufacturerName": "Sample Manufacturer",
          "displayCategories": [
            "CAMERA"
          ],
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa.MediaMetadata",
              "version": "3",
              "proactivelyReported": true
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.CameraStreamController",
              "version": "3",
              "cameraStreamConfigurations" : [
                  {
                    "protocols": ["RTSP"],
                    "resolutions": [{"width":1920, "height":1080}, {"width":1280, "height":720}],
                    "authorizationTypes": ["BASIC"],
                    "videoCodecs": ["H264", "MPEG2"],
                    "audioCodecs": ["G711"]
                  },
                  {
                    "protocols": ["RTSP"],
                    "resolutions": [{"width":1920, "height":1080}, {"width":1280, "height":720}],
                    "authorizationTypes": ["NONE"],
                    "videoCodecs": ["H264"],
                    "audioCodecs": ["AAC"]
                 }
              ]
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.EndpointHealth",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa",
              "version": "3"
            }
          ]
        }
      ]
    }
  }
}

For information about building a smart home skill for cameras, see Build Smart Home Camera Skills.

For more details on state reporting, see Understand State Reporting for a Smart Home Skill.

If the device has additional capabilities, you can add other capability interfaces.