Today we announced that we now enable companies to control entertainment devices with the Smart Home Skill API in the Alexa Skills Kit. Here is an overview of how to connect your TVs, AV Receivers, IR Hubs, and even connected speakers to Alexa. This post explains the basic mechanics of connecting your entertainment device to Alexa, and includes links to more resources to help you get started.
There are two main parts to creating a smart home skill to connect your entertainment devices. First, you will need to build a smart home skill and report entertainment devices along with their interface capabilities as part of the discovery response payload. After device discovery, you will then need to act on requests associated to each interface.
When you create a skill for entertainment devices, you need to make sure you receive messages for the entertainment device in the Smart Home Skill API. With today’s launch you can report these six capabilities: PowerController, ChannelController, PlayBackController, StepSpeaker, Speaker, and InputController. Each capability is a direct mapping between what Alexa and the device supports. Below is a sample Discovery Response. In this case the device only supports Speaker, ChannelController, and PlayBackController interfaces, therefore it reports only those capabilities via the Discovery Response.
{
"event":{
"header":{
"namespace":"Alexa.Discovery",
"name":"Discover.Response",
"payloadVersion":"3",
"messageId":"5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4"
},
"payload":{
"endpoints":[
{
"endpointId":"appliance-001",
"friendlyName":"Living Room Entertainment System",
"description":" Entertainment System by Sample Manufacturer",
"manufacturerName":"Sample Manufacturer",
"displayCategories":[],
"cookie":{
"extraDetail1":"optionalDetailForSkillAdapterToReferenceThisDevice",
"extraDetail2":"There can be multiple entries",
"extraDetail3":"but they should only be used for reference purposes",
"extraDetail4":"This is not a suitable place to maintain current device state"
},
"capabilities":[
{
"type":"AlexaInterface",
"interface":"Alexa.Speaker",
"version":"1.0",
"properties":{
"supported":[
{
"name":"volume"
},
{
"name":"muted"
}
]
}
},
{
"type":"AlexaInterface",
"interface":"Alexa.ChannelController",
"version":"1.0",
"properties":{
"supported" :[
{
"name":"channel"
}
]
}
},
{
"type":"AlexaInterface",
"interface":"Alexa.PlaybackController",
"version":"1.0",
"properties":{}
}
]
}
]
}
}
}
After device discovery, you will need to act on requests associated to each interface. These requests are formed after Alexa understands the customer’s speech using Amazon’s standardized Alexa language mode and converts them into request messages that your skill understands. For example - a customer request “Alexa Change Channel to CNN” is transformed into ChannelController interface with “ChannelChange” and “CNN” reported in the request message. These requests are sent to your skill which you can then use to act on your device and send a response back to Alexa. The response that you send back to Alexa is important because this helps Alexa communicate the correct response back to the user. Each request and response has different payloads depending upon the message and the interface used. Please review our documentation on Entertainment Controls for more technical details.
You can connect your entertainment device to Alexa by following these steps:
We look forward to seeing what you create with these new capabilities. To learn more about developing a smart home skill check out these resources:
Developers have built more than 15,000 skills with the Alexa Skills Kit. Explore the stories behind some of these innovations, then start building your own skill. If you’re serious about getting into building voice UIs, we’d like to help you explore. If you publish a skill in July and apply for our promotion, we’ll send you an Echo Dot and some new Alexa swag so you can experiment and daydream.