Discovery Response Examples


You implement the Alexa.Discovery interface to inform Alexa about the capabilities of the customer's connected devices. To help you get started, review the discovery response examples to find one that matches your device type. You can use these example Discover.Response messages in your skill code. Modify the example by adding or removing interfaces to suit the needs of your specific device. To see example discovery responses for other capabilities, see the documentation for each interface.

For ideas about how to combine different interfaces in your Alexa skills, see Smart Home Skill Device Templates.

Example for a camera that supports pan, tilt, and zoom

The following example shows a Discover.Response event for an Alexa skill that controls a security camera, such as a front door camera or a nursery camera. The camera supports the Alexa.RTCSessionController interface for communication between Alexa devices and the camera. And the camera can physically pan left and right, tilt up and down, and zoom in and out. The skill implements the Alexa.RangeController interface to support pan, tilt, and zoom.

A camera can support any subset of pan, tilt, and zoom. For pan and tilt, specify ranges as percent of the Field of View (FOV) of your camera. For example, if your camera has a 90 degree horizontal FOV, and can rotate 360 total degrees, the range of motion is 400%. You can define your total supported range as 0–400 or –200–200. Define the pan range as –200–200 so that 0 represents the center. The tilt range is –-50–50, and the zoom range is 0–200.

Example for an entertainment device

The following example shows a Discover.Response event for an Alexa skill that controls an entertainment device.

Example for a fireplace

The following example shows a Discover.Response event for an Alexa skill that controls a fireplace. This fireplace uses the following interfaces:

This example is part of a tutorial that builds a Smart Home virtual fireplace skill. For details, see Skill Sample: Smart Home Fireplace (Python) on GitHub.

The friendly names give users more flexibility in how they speak to Alexa. For details, see Friendly Name Resources and Assets.

Example for a guitar amp

The following example shows a Discover.Response event for an Alexa skill that controls a guitar amp.

This example provides friendly names that give users more flexibility in how they speak to Alexa. For details, see Friendly Name Resources and Assets.

Example for a thermostat that requires action verification

The following example shows a Discover.Response event for an Alexa skill that controls a thermostat. This skill uses the Alexa.PowerController interface to turn the thermostat on and off and the Alexa.ThermostatController interface to control the temperature and the mode.

This skill requires the user to verify any actions for this endpoint before Alexa performs them, therefore this Discover.Response includes a verificationsRequired object for each interface that supports it. For details, see VerificationsRequired object.

Example for a video device

The following example shows a Discover.Response event for an Alexa skill that controls a video device.

Example for a water heater

The following example shows a Discover.Response event for an Alexa skill that controls a water heater as described in Water heater.

In this example you use the Alexa.ToggleController interface to support Alexa hunches. For details about hunches, see What Are Alexa Hunches? and Enable Alexa to Proactively Act on Hunches Without Customers Needing to Ask.

This example also uses the Alexa.DeviceUsage.Meter interface to help users manage their energy usage with the Alexa energy dashboard. For details, see Smart Home Energy Overview.

Example for a Wi-Fi router

The following example shows a Discover.Response event for an Alexa skill that controls a Wi-Fi router as described in Wi-Fi Router.

This example provides friendly names that give users more flexibility in how they speak to Alexa. For details, see Friendly Name Resources and Assets.


Was this page helpful?

Last updated: Mar 26, 2024