Understand Smart Home Skills
When you build an Alexa smart home skill, users can voice-control their cloud-connected devices by using your skill. The smart home interfaces use the pre-built voice interaction model. This model gives you a set of predefined utterances that users say to control your device. When a user speaks to Alexa, Alexa interprets the utterance and sends a message to your skill that communicates the request. Your skill reacts to the message by changing the state of the device, such as by dimming a light, or by sending information about device state, such as by telling the user whether a light is on or off.
If you want to connect your smart home device to Alexa without a skill, see Smart Home Device Connection Options. If you want to connect your Alexa Built-in device to Alexa, see AVS Device SDK Smart Home Endpoints. If you want to integrate a hardware module into your product to connect to Alexa, see Alexa Connect Kit.
For an overview of other kinds of Alexa skills that you can build with the Alexa Skills Kit, see Index of Skill Types.
Who can develop smart home skills for Alexa
Anyone can develop a smart home skill. The Smart Home API uses the pre-built voice interaction model which defines the utterances that users say to interact with your skill. Alexa knows how to interpret the user's speech and what directives to send to your skill.
Smart home skill development falls into two categories:
- Device manufacturers that want to enable customers to interact with their cloud-connected devices by using their voice.
- Independent developers who want to create an Alexa skill for cloud-connected devices, either for their own private use or general public use.
You can build your own smart home skill or work with experienced solution providers to help you connect your devices to Alexa. For a list of solution providers, see Works with Alexa IoT Solution Providers.
What kinds of devices does the Smart Home API support?
You can connect almost any type of device to Alexa by using the Smart Home API. You decide how you want the user to interact with your device, and then in your skill, you implement the capability interfaces that enable those interactions. For example, if your device is a lamp, and you want the user to be able to turn the lamp on and off, you implement the
Alexa.PowerController interface in your skill.
Most devices implement multiple interfaces to enable voice interaction with multiple features. For the full list of smart home interfaces, see List of Alexa Interfaces.
Some Alexa interfaces support specific device types, but other interfaces support many kinds of devices. For example, implement the
Alexa.ThermostatController interface only for thermostats, but implement interfaces like
Alexa.PowerLevelController for many kinds of devices.
Whenever possible, choose an interface that's specific to your device because that enables Alexa to support more specific functionality. For example, you could model the concept of device brightness with
Alexa.RangeController, but if you implement the
Alexa.BrightnessController interface instead, Alexa provides built-in support for the phrase "Alexa, dim the lights."
For recommendations about what interfaces to implement for some common device types, see Smart Home Skill Device Templates.
How the Smart Home API works
The Smart Home API provides capability interfaces that enable you to describe your devices and the properties, events, and directives that they support. You describe your device to Alexa by sending a
Discover.Response event after receiving a
Discover directive from Alexa during the device discovery process. Alexa uses this description of your device and its capabilities to automatically enable certain functionality, such as:
- Pre-built voice interaction model for many common commands.
- Contextual targeting, which lets Alexa use context clues, such as device groups, to issue commands that target the proper device even when the customer isn't explicit.
- Controlling devices through routines.
- Viewing and controlling devices with the Alexa app.
In addition to supporting voice requests, the API also enables you to provide updates when the state of a device changes. Proactive updates enable users to ask Alexa about a device and see an up-to-date status of the device in the Alexa app. For example, a customer can use the Alexa app to check the temperature of their home or see if a light is on.
To support these customer scenarios, the Smart Home API has the following features:
- Capability interfaces – These interfaces describe a device's functionality. A device, or endpoint, can implement the combination of capability interfaces that best represent its features. For example, a light that you can turn on and off and dim might implement two interfaces:
Alexa.BrightnessController. A similar light that has these two features and also supports tunable white light might also implement
- Synchronous and asynchronous messaging – When Alexa sends a directive, your smart home skill responds either synchronously or asynchronously. You're free to choose asynchronous or synchronous responses or a combination of the two, whichever works best for your device and cloud architecture.
- Device state change notifications – You can provide proactive state updates to Alexa in event messages. Alexa can then provide this information in the Alexa app and enable customers to take action, if needed. For example, if a door unlocks, you can send this change report to Alexa and the change appears in your customer's Alexa app.
- Querying state – Capability interfaces define properties that Alexa can query to enable customers to check the current state of a device by asking Alexa or by using the Alexa app.
The following image shows an overview of the functionality offered by smart home skills.
- A customer enables your smart home skill, links the skill to their account with your device cloud, and then asks Alexa to discover devices associated with that account.
- Later, the customers says, for example, "Alexa, turn the kitchen light to 50 percent", or makes a change to a device setting in the Alexa app. Alexa uses information from the customer's utterance or the app to compose a message that identifies the endpoint and the operation to perform. Alexa sends this message, called a directive, to your skill to control the kitchen light. The directive includes:
- The capability message, for example, BrightnessController.SetBrightness, which includes the new setting value.
- The endpoint identifier. In this example, the ID representing the endpoint that the customer named "kitchen light".
- Information that authenticates the customer.
- Your skill code, hosted in AWS Lambda, a compute service offered by Amazon Web Services (AWS), receives and parses the directive, and then validates the authentication information. Your skill communicates with your device, or device cloud, using communication channels you've defined, to set the brightness on the customer's kitchen light.
- Your skill responds to Alexa with a message called an event that indicates whether the operation was successful. You have the option of sending the event synchronously from the Lambda function or asynchronously from the device cloud. Alexa uses this response to provide the appropriate response to the customer. For example, Alexa might say, "OK" to indicate that the requested directive was successfully handled.
- Later, the customer switches off the kitchen light manually. This action causes your skill to send a change report event to Alexa to indicate that the light is now off.
Works with Alexa guidelines
Works with Alexa (WWA) is a certification program that establishes your product's compatibility with Alexa and helps your customers have a better smart home experience. When your products receive certification, they can carry the Works with Alexa badge in the Amazon Smart Home Store and on product packaging. For details, see Works with Alexa Overview.
Next steps to create a skill
To get started, see Steps to Build a Smart Home Skill.
- Smart Home Skill Concepts
- Smart Home Skill Types
- Alexa Interface Reference
- Smart Home Skill API Developer Forum
Was this page helpful?
Last updated: Aug 22, 2022