Create the Skill
Tutorial: Build a Smart Home Skill
In this tutorial, you use the Alexa developer console to walk through the steps to build a fictional smart home skill that connects to Alexa. This skill enables users to control a virtual light bulb with their voice.
Smart home skills use the pre-built voice interaction model and Alexa defines the set of utterances for you. For a device, such as a light bulb, that has states of On and Off, Alexa supports the following user utterances.
User: Alexa, turn on the light.
User: Alexa, turn off the light.
Alexa converts the user utterances into directives with a specific JSON structure. Then, Alexa sends the directives to your skill. Your skill processes the directives and performs the requested action by communicating with your device in the cloud. Your skill sends responses back to Alexa indicating success or failure of the request. The response includes the current state of the device.
For details about smart home skills, see Understand Smart Home Skills.
Before you start, you need an Amazon developer account. You can use an existing Amazon account to sign in, or you can create a new Amazon developer account. The account is free.
To host your smart home skill, you need an Amazon Web Services (AWS) account in addition to your Amazon developer account. The AWS account gives you access to resources as part of the free tier of services.
To test the skill, you need an Alexa-enabled device, or you can download the Amazon Alexa app to your mobile device. For instructions about how to download the Alexa app, see Download the Alexa app on the Amazon.com website. Make sure that you sign in to the Alexa app on your mobile device with the same credentials as your Alexa developer account.
Steps to build a smart home skill
To build a smart home skill that controls a virtual light bulb, complete the following steps.
Other learning resources
The smart home skill that you build in this tutorial lets the user control their light bulb from Alexa. You also want to let Alexa know when the state of the bulb changes externally so that Alexa can report the correct status in the Alexa app. For example, someone might turn off the bulb manually or the bulb might lose connectivity to your skill. To report state to Alexa , you send state and change reports. After you complete the tutorial, learn how to set up your skill to send change reports with Smart Home Skill Sample: Send Change Report on GitHub.
This tutorial focuses on a simple smart home skill to control a light bulb. Alexa supports many types of smart home skills. For details, see Smart Home Skill Types and Video Skills. You can also build Multi-capability Skills that combine the features of multiple skill types, such as a smart home and video skill, or a smart home and custom skill.
You can create smart home skills in other languages. For details, see Develop Smart Home Skills for Multiple Languages. Language support varies by interface. For details, see List of Alexa Interfaces and Supported Languages.
Was this page helpful?
Last updated: Feb 02, 2024