Alexa Blogs

Alexa Blogs

Want the latest?

alexa topics

Recent Posts

Archive

September 27, 2016

Michael Palermo

Today’s post comes from J. Michael Palermo IV, Sr. Evangelist at Amazon Alexa. You will learn the process of device discovery and how to support it in code for your smart home skill.

Developing a smart home skill is different than building a custom skill. One of the main differences is the dependency on devices to control. The device might be a light bulb, thermostat, hub, or other device that can be controlled via a cloud based API. Or maybe you created an innovative IoT gadget and you want to make it discoverable by an Alexa enabled device. In this post, you will learn how the process of device discovery works, and how you can support discovery in your custom skill adapter communicating with the Smart Home Skill API.

To meet prerequisites and set the context of the technical information in this post, start by reading the five steps before developing a smart home skill and set up your initial code to support skill adapter directive communications. This post will be the next in the series of these posts and provides the foundation for code samples to follow.

Understanding the Customer’s Perspective of Device Discovery

To appreciate the role of device discovery, consider how a customer is involved in the process. The following steps assume a consumer has an Alexa-enabled device, such as the Echo or Echo Dot, already set up.

  1. Customer physically installed a smart home device and followed instructions likely requiring customer to create an account to log into an app or web site used to associate/control the device.
  2. Customer opens Alexa app and enables the smart home skill associated with device. Customer is immediately prompted to sign in with credentials used in previous step.
  3. Customer either selects the ‘discover devices’ link in the Smart Home section of the Alexa app, or verbally commands it by saying “Alexa, discover devices.”

Once the first step is completed, the customer is able to control the smart home device typically through an app provided by the device maker, which is graphical user interface that manages device and owner information controlled in it’s own device cloud. The account created in the first step is the same account used in the second step when the consumer enables the associated smart home skill. This explains why account linking is mandatory for skills created with the Smart Home Skill API.

But what happens in the third step when the consumer makes a device discovery request? Does it actually seek for devices emitting some signal within the home? Is it querying everything it can within the local WIFI area? The answer to both questions is no. Although there are a couple of exceptions to enable early support of popular products such as Philips Hue and Belkin WeMo, the process described next is what is supported today and moving forward.

How Device Discovery Works


Figure 1: Device discovery process

When a request is made by the customer for devices to be discovered, the Alexa service identifies all the smart home skills associated with the consumers account, and makes a discover request to each one as seen here.

Let’s examine each step above in more detail. Notice the first step is the same as the last step we covered when considering the customer’s perspective, so this is a deeper dive as to what happens next. Also observe in Figure 1 that no communications occur directly between the Amazon Echo and the smart home device.

[Read More]

September 21, 2016

Ted Karczewski

Last month, we announced the launch of Nucleus, the smart home intercom that’s always getting smarter with Alexa. Designed to bring families closer together, Nucleus makes two-way video conferencing between rooms, homes, and mobile devices instantaneous. Following the successful launch of Nucleus on Amazon.com and in hundreds of Lowe’s home improvement stores throughout the US, we’re excited to announce that Alexa Fund has led a $5.6 million Series A investment round in Nucleus, with additional participation from BoxGroup, Greylock Partners, FF Angel (Founders Fund), Foxconn, and SV Angel.

“It’s incredible to receive this level of support in such a short period of time,” said Jonathan Frankel, co-founder and CEO of Nucleus. “It speaks to the importance of our shared vision: Bringing families closer together through intuitive and intelligent interfaces. Amazon has been a stand-out supporter since day one and recognizes the value Nucleus is bringing to families nationwide, and the rapid market traction we’re seeing within our growing community.”

The Alexa Fund provides up to $100 million in venture capital funding to fuel voice technology innovation. We believe experiences designed around the human voice are a more natural way for people to interface with technology. Nucleus combines ease-of-use and the Alexa Voice Service (AVS) to create an intuitive voice experience where customers can stream music, access custom Alexa skills, and more just by asking Alexa. Nucleus joins past Alexa Fund recipients Luma, Sutro, Invoxia, Musaic, Rachio, Scout Alarm, Garageio, Toymail, Dragon Innovation, MARA, Mojio, TrackR, KITT.AI, DefinedCrowd, and Ring.

Nucleus is the first touchscreen device to incorporate AVS, making it easy for customers to stream music, control smart home products such as SmartThings, Insteon and Wink, and access the library of 3,000 Alexa skills. Read more about how Nucleus and the Alexa Voice Service (AVS) worked together to bring the company’s smart video intercom system to life in this morning’s featured developer spotlight interview.

Nucleus is available for purchase on Amazon.com.
Build your own skill for Alexa and the growing family of Alexa-enabled devices with the Alexa Skills Kit.

[Read More]

September 21, 2016

Ted Karczewski

In early 2014, Jonathan Frankel started renovating a house in Philadelphia. With three kids and multiple floors, he wanted an intercom system, but was frustrated with the persistence of old technology. He found that home intercoms hadn’t changed much in the last 30 years; they were still expensive and difficult to install. What’s more, intercom systems had failed to keep up with today’s modern families who are spread across geographies and constantly on the move.

Frankel, now CEO of Nucleus, wanted to bring families closer together. He wanted to build a device that could bridge generations and let his mom video chat with his children with a simple touch. He wanted to visit with his family over dinner, even while away on business. Whenever, whoever, and wherever they may be, he wanted to talk to them—room-to-room, home-to-home, or mobile-to-home.

Now his vision has come to life. Nucleus, the first smart home intercom with video calling, and with the voice capabilities of Alexa, is delighting customers with easy access to music, news, weather, to-do lists, and even smart home controls.

An innovative product made even better with voice

Amazon created the Alexa Voice Service (AVS) to make it easier for developers to add voice-powered experiences to their products and services. That proved advantageous for Nucleus.

According to Isaac Levy, chief technology officer at Nucleus, hands-free interaction was part of the Nucleus vision from the beginning. They prototyped early Nucleus units with various voice recognition solutions, including open source. When they heard about the commercial availability of AVS, they knew their search was over.

“We knew right away that AVS would be a great fit, and we wanted to incorporate it into our product,” Levy said. “It’s one thing to have basic voice recognition. But being able to unlock everything Alexa can do—weather, sports, flash briefings, all those custom skills…it’s like waking up a genie in our device. AVS helped Nucleus create an even more compelling customer experience.”

Levy says AVS allowed his team to develop a more full-featured Nucleus with capabilities the company hadn’t developed on its own. For example, natural language understanding (NLU) is built into the Alexa service, providing developers with an intelligent and intuitive voice interface that’s always getting smarter. This saved Nucleus many years of development work.

[Read More]

September 20, 2016

Marion Desmazieres

Today, we’re excited to announce a new, free video course on Alexa development by A Cloud Guru, a pioneering serverless education company in the cloud space. Instructed by Ryan Kroonenburg, an Amazon Web Services (AWS) Community Hero, the “Alexa development for absolute beginners” course allows beginner developers and non-developers to learn how to build skills for Alexa, the voice service that powers Amazon Echo.

Here is what you can expect to learn in this two-hour course in 12 lessons:

  • This beginner guide to Alexa will walk you through setting up an AWS account, registering for a free Amazon Developer account, and then building and customizing two Alexa skills with templates available on GitHub.
  • The course also shows Mac users how to use the interactive story tool to create amazing interactive stories.
  • Finally, you will learn how to create your own mp3 files, where you narrate, and how to add background music and sound effects. You will see how to convert mp3 files to an Alexa-friendly format, put them on Amazon S3, and then reference them in the graphical user interface (GUI) using Speech Synthesis Markup Language (SSML).

“All in all, it's a great course and it’s even accessible to non-developers, mums and dads who haven’t used Alexa or Amazon Web Services before! We made this available to the general public and give them an everyday use case for AWS Lambda, Amazon DynamoDB, and S3. We can’t wait to see what people build for Alexa.” – Ryan Kroonenburg, instructor and founder of A Cloud Guru.

Watch the course for free today.

Dive Deeper with Alexa Development

A Cloud Guru also offers an extended version of the course. Cloud Solution Engineer Nick Triantafillou will teach you how to build your own Alexa device with a Raspberry Pi, a MicroSD card, a speaker, a USB microphone, and Alexa Voice Service. Learn how to make Alexa rap to Eminem, how to read Shakespeare, how to use iambic pentameter and rhyming couplets with Alexa, and more. This five-hour video course in 47 lessons also covers additional skill templates available on GitHub to customize and build new capabilities for Alexa.

Watch the extended course.

Check out these Alexa developer resources:

 

 

September 16, 2016

Glenn Cameron

The Internet of Voice Challenge on Hackster.io has officially come to a close. Our spirits are high after seeing the heights of creativity, the quality of code, and the compelling narratives of the 101 entrants. Simply put, we are impressed with how developers connected Alexa with Raspberry Pi.

After careful deliberation, we are announcing the winners!

Winners of the Internet of Voice Challenge

Alexa Skills Kit + Raspberry Pi segment

1st Place: Roxie the Voice-Activated Pitching Machine by Terren Peterson

The cold efficiency of a pitching machine is a great way to learn to hit a ball, but it’s so impersonal. Instead, Robot Roxie is powered by Alexa and lets you ask for the next pitch.

Watch Robot Roxie in action.

2nd Place: Voice-Controlled K’nex Car by Austin Wilson

This developer revived his old builder set and decided it was more fun to control it with his voice. Watch the Alexa-enabled K’nex buggy show off some of its moves.

[Read More]

September 16, 2016

Zoey Collier

When Belkin International launched its WeMo line of connected devices in 2012, it wasn’t its first foray into consumer electronics. Belkin has been around for 30 years, transforming its business from cabling to connectivity, wireless networking, and eventually into home automation.

According to CJ Pipkin, Belkin’s national account manager for WeMo, the farther the company delved into wireless networking, the more it realized people wanted to remote-control devices of all kinds around the home. So Belkin transformed its Zensi energy-monitoring devices into what become WeMo—a line of smart, remote-controlled and remotely-monitored switches.

“We built a smart ecosystem of connected devices as early as anyone in the industry,” Pipkin says.

Belkin makes a variety of devices, but high-quality switches dominate its WeMo home automation lineup:

  • WeMo switch – smart outlet you control from anywhere (Wi-Fi, 3G, 4G)
  • WeMo Insight switch (control and monitor power usage from anywhere)
  • WeMo light switch that replaces a standard light switch

But since Amazon Echo and Alexa came on the scene, it’s completely changed Belkin’s way of thinking. They realized one household user—the techiest one—had previously dominated WeMo usage. With Alexa, though, anyone can operate a connected device with ease.

Tom Hudson, software product manager for WeMo, says smartphones were a natural way to control home devices at first, especially lighting. They are handy for configuring set-it-and-forget-it automations to respond to specific events. For more immediate actions, though, voice actuation is so much better. “It’s a lot easier to just say, ‘Turn that light on’ than it is to pull out your phone, find and load up the app, then locate and tap the right command.”

[Read More]

September 15, 2016

Robert McCauley

We teamed up with hack.guides() to bring you a Tutorial Contest in June. Hack.guides() is a community of developers focused on creating tutorials to help educate and share technical knowledge. The purpose of the contest was to provide developers the opportunity to share knowledge, help other developers, contribute articles to an open-source project, and win a prize along the way.

Today we’re excited to announce the winner of the hack.guides() tutorial contest.

Winner: Control your fish tank from anywhere in the world with Alexa voice control

Alexa developer, ”piratemrs”, built a tutorial that outlines how to build a working, voice-controlled device that can be used to feed pet fish while you are away. The tutorial helps developers learn three broad technical areas: hardware, AWS, Alexa.

Both cloud and hardware technologies were integrated to build this project. The tutorial starts with a lesson on how to add external circuits and motors (servos) to a Raspberry Pi computer. Next, the tutorial steps through how to create an AWS Lambda function and Alexa skill. Finally, the skill and Raspberry Pi system are tied together via a configuration guide using the AWS IoT service. At the end, piratemrs says “Alexa, ask fish tank to feed the fish” and a custom Alexa skill activates a small motor to shake some food into the fish tank. 

The tutorial does a great job of breaking down components into separate sections and includes YouTube videos to show the results of testing each piece of the solution. Watch the videos and focus on testing and understanding each component of the solution before moving on.

Read the full tutorial to learn how you can build your own voice-controlled system to feed your fish, control your fish tank lights remotely, and more.

Honorable mentions

We’d like to thank all the participants who created Alexa tutorials for this contest. The high quality of submissions made selecting a winner a difficult decision. Tutorial submissions were scored using the contest rules provided by hack.guides(), including writing style, communication ability, effective use of technologies/APIs, and overall quality. Here are some honorable mentions.

Alexa, run this JavaScript app

This tutorial shows you how to design, build, and test an Alexa skill that implements an adventure game. If you are an experienced Node.js developer, but new to Alexa, you will appreciate the thorough breakdown of the ASK functionality and recommended project structure. Read more

Build your first Alexa skill

This tutorial shows you how to navigate the Amazon developer screens and create your first Alexa skill. If you are a novice developer, you will appreciate the clear screenshots and fun animated GIFs that appear throughout the text. Read more.

Get Started with the Alexa Skills Kit

To get started, we’ve created easy-to-use skill templates that show new developers the end-to-end process of building an Alexa skill. Visit our trivia game, fact skill, how-to skill, flash cards skill and user guide skill tutorials.

Or check out these Alexa developer resources:

 

 

September 14, 2016

Dean Bryen

Amazon is happy to announce that Alexa, Echo, and the all-new Echo Dot are now available for customers in the UK and Germany. Developers and hardware makers around the world can create Alexa skills for UK and German customers with the Alexa Skills Kit (ASK) today or integrate Alexa into their hardware with the Alexa Voice Service (AVS) starting in early 2017. Popular European brands have already announced they’re building Alexa skills, including JustEat, the BBC, The Guardian, Jamie Oliver, MyTaxi, Hive, Netatmo, National Rail and Deutsche Bahn. There are over 3,000 skills for Alexa in the US, and now developers can extend their experiences to more customers in Europe. If you publish a skill for the UK or Germany by October 31, 2016, you’ll receive a free, limited edition Alexa t-shirt.

Introducing the Echo and Echo Dot

Today we also introduced an all-new version of the groundbreaking Echo Dot for under $50, so you can add Alexa to any room in your home. Both Amazon Echo and Echo Dot are voice-controlled speakers designed entirely around your voice—they’re always ready, hands-free, and fast. Alexa is the brain behind Echo and Echo Dot—just ask, and she’ll answer questions, play music, read the news, set timers and alarms, recite your calendar, check sports scores, control lights around your home, and much more. With far-field voice control, Echo and Echo Dot can do all this from across the room. Echo and Echo Dot will start shipping in the UK in the coming weeks. In Germany, Echo and Echo Dot are available by invitation for customers who want to help shape Alexa as she evolves—the devices will start shipping next month.

How to Build an Alexa Skill

It’s easy to get started. Explore our simple tutorials to learn how to build a skill quickly: trivia, flash cards, instructions, facts, decision tree and game helper. If you want to build a multi-language Alexa skill read our technical documentation to learn how to create a skill in all language models (US English, UK English, and German). If you’re already an Alexa developer, you can enhance your existing skill by extending it to support both UK and DE language models.  

Get Technical Help from the Alexa Team

Join us at an Alexa event or in our webinars and office hours in the coming weeks. These sessions are an opportunity for you to have your questions answered by an Alexa Evangelist or Alexa Solutions Architect.

Webinars

We have scheduled three introductory live webinars.

ASK the Expert Sessions

We host ASK the Expert sessions to help answer your questions. Join the next one for live Q&A with an Alexa Evangelist.

Technical staff from the Alexa team will be speaking at a number of upcoming events in the UK and Germany. Come join us to get hands-on training, learn about voice design and meet other local developers.

UK

  • SmartSummit (London) – September 21 -22 Register Now
  • Amazon Appstore Summit (London) – October 4  Register now
  • Hello Alexa (London) – October 10  Register with code “HiLondon.” Seats are limited.
  • Hello Alexa Bootcamp (London) – October 11  Register now
  • Hack Sheffield – October 15-16  Register now
  • Brumhack – October 29-30 Register now
  • Alexa Devs Meetup (London) October 4  Learn more

Germany

  • Berlin Bootcamp – September 21-22 Register now
  • Hello Alexa (Berlin) – October 6 Register with code “HalloBerlin.” Seats are limited.
  • Hello Alexa Hackathon (Berlin) – October 7  Register now
  • Jacobschack – October 15-16  Register now
  • Alexa Devs Meetup (Berlin)  Learn more

Special Offer: Free Developer T-Shirts for UK and DE

We are offering a free Alexa Dev t-shirt to developers who publish an Alexa skill between September 14, 2016 and October 31, 2016. There are custom, limited edition designs for the UK and Germany. Quantities are limited. See terms and conditions.

 

September 14, 2016

Dean Bryen

Today, we announced that Amazon Echo and Alexa is coming to the UK and Germany. With the announcement comes two new language models: English (UK) and German. You can start developing for these new languages today.

Now that Alexa is multi-lingual, this tutorial shows you how to deliver the right content to your customers in each of the supported regions- all from a single code base.   This post assumes you have some familiarity with JavaScript/Node.js and the Alexa Skills Kit. To learn more about using the Alexa Skills Kit, please watch this video. For guidance on designing a voice experience with Alexa, please see this video.

In this tutorial, you’ll build a web service to handle notifications from Alexa and map this service to a skill in the Amazon Developer Portal, making it available on your device and to all Alexa users upon certification.

After completing this tutorial, you’ll know how to do the following:

  • Create a multi-language skill - This tutorial will walk first-time Alexa skills developers through all the required steps involved in creating a basic skill. Your skill will support English (UK) and German language models. You can also add support for the US English language model.
  • Understand the basics of VUI design - Creating this skill will help you understand the basics of creating a working Voice User Interface (VUI) while using a cut/paste approach to development. You will learn by doing, and end up with a functioning Alexa Skill.
  • Use JavaScript/Node.js and the Alexa Skills Kit to create a skill - You will use the template as a guide but the customization is up to you. For more background information on using the Alexa Skills Kit please see this video.

Let's Get Started

Step 1. Setting up Your Alexa Skill in the Developer Portal

Skills are managed through the Amazon Developer Portal. You’ll link the Lambda function you created above to a skill defined in the Developer Portal.

1.  Navigate to the Amazon Developer Portal. Sign in or create a free account (upper right). You might see a different image if you have registered already or our page may have changed. If you see a similar menu and the ability to create an account or sign in, you are in the right place.

2.  Once signed in, navigate to Alexa and select "Getting Started" under Alexa Skills Kit.

[Read More]

September 09, 2016

Zoey Collier

Do you develop in Amazon Web Services (AWS), have an Echo, and want the latest service availability details without having to open your laptop and scroll through dozens of green checkmarks? A home-schooled student named Kira Hammond has the solution with her newly-released CloudStatus Alexa skill.

CloudStatus summarizes the info on the AWS Service Health Dashboard, both current issues and recent problems. On a challenging day, Alexa’s conversation might start out like this:

“Hello! 3 out of 11 AWS regions are experiencing service issues—Mumbai (ap-south-1), Tokyo (ap-northeast-1), Ireland (eu-west-1). 1 out of 11 AWS regions was having problems, but the issues have been resolved—Northern Virginia (us-east-1). The remaining 7 regions are operating normally. All 7 global services are operating normally. Which Amazon Web Services region would you like to check?”

Interested? Listen to a recording of an example session or try it for yourself, say, “Alexa, enable the CloudStatus skill.”

Why this particular skill

Kira wrote CloudStatus with AWS Lambda, using Amazon EC2 to build Python modules for Requests and LXML. The modules download and parse the AWS status page to provide the desired data. The Python packages and the skill’s code files are zipped and uploaded to AWS Lambda.

Kira created this skill because her father, Eric Hammond, an AWS Community Hero and Internet startup technologist, wanted a simpler, easier way to access the service availability info himself. He figured having Kira create the skill would enable her to learn about retrieving and parsing web pages in Python—and being a good parent, he wanted to foster her creativity. And Kira is very enthusiastic about the creative process of development. “Programming is so much fun and so rewarding! I enjoy making tools so I can be lazy. Coding can be challenging (even frustrating) and it can be tempting to give up on a debug issue. But, oh, the thrill that comes after solving a difficult coding problem!”

[Read More]

September 07, 2016

David Isbitski

When creating your own Alexa skill, there may be times when you would like to change the way Alexa speaks.  Perhaps she isn’t pronouncing a word correctly, maybe her inflections are too serious or you may find the need to include a short audio clip. Speech Synthesis Markup Language, or SSML, is a standardized markup language that provides a way to markup text for changing how speech is synthesized. Numerous SSML tags are currently supported by the Alexa Skills Kit including: speak, p, s, break, say-as, phoneme, w and audio.

This 20-minute video will walk you through adding SSML support to your Alexa skill and shows exactly how to pause Alexa’s speech, change how she pronounces a word and how to create and embed your own audio tags.

For more information about getting started with Alexa and SSML, check out the following:

Speech Synthesis Markup Language (SSML) Reference
Alexa Dev Chat Podcast
Intro to Alexa Skills On Demand
Voice Design 101 On Demand
Alexa Skills Kit (ASK)
Alexa Developer Forums

-Dave (@TheDaveDev)

 

September 02, 2016

Zoey Collier

In April 2016, developer Aaron Roberts put the finishing touches on Alarm.com’s custom Alexa Skill. That wrapped up almost three months of development and internal and beta testing. All that testing led to a smooth certification process.

Rebecca Davenport, Director of Product Management at Alarm.com, says the Alarm.com skill controls more than just home security. It also controls almost every other device that’s part of the company’s home automation ecosystem. That includes security equipment, door locks, garage doors, video cameras, lights and thermostats.

The company's founders recognized the limitations of traditional landline-based alarm systems. Besides relying on phone wires—which can be tampered with and unreliable —customers often forgot to arm their systems. The company saw a unique opportunity to allow customers to arm and disarm the system and know what’s happening at their home from anywhere.

Alarm.com enhanced its offering with its first mobile app. At the same time, it started expanding its core platform beyond security into home automation and video. Today over two million Alarm.com customers control their smart home devices from their phones, tablets, TV, and more.

Voice control: The next evolution in Alarm.com’s smart home ecosystem

When Amazon Echo and Alexa debuted, Alarm.com saw another huge opportunity. With the launch of the Alexa Skills Kit (ASK), the company knew voice technology’s time had come. “We had voice technology on our radar,” Davenport says. “Voice control is a compelling way for customers to interact with their devices from within their homes.”

The software team didn’t start developing a custom Alexa skill right away. Instead, Roberts started his own early exploration and prototype during the ASK beta. When the integration project got the green light, he was ready.

Roberts said using the ASK API was straightforward. He found mapping the API responses to Alarm.com’s existing web services was the simplest part of the project. As for the rest, he recalls the major components:

Refining the Voice User Interface (VUI)

The team members brainstormed all the ways they thought users would request a command. Like many developers new to voice applications, they found customers don’t always say what you expect.

[Read More]

September 01, 2016

Noelle LaCharite

We are excited to share a new template for developers, GameHelper. This template helps you build game guides or user guides for your favorite game. In this tutorial, we will build a skill that tells you how to play chess. There will be five main interaction points that will provide information about how to play the game. The skill in this example will also have the ability to provide a user with a random tip to help improve a user’s game. For this game we also thought it would be interesting to allow the user to ask Alexa about a certain chess piece and get some information about it.

This skill can be adapted to accommodate your favorite game, by changing some basic text. It is also possible to add extra functionality to show features of your favorite game.

After completing this tutorial, you'll know how to do the following:

  • Create a decision-based skill - This tutorial will walk first-time Alexa skills developers through all the required steps involved in creating a decision-based skill using a template called ‘GameHelper’.
  • Understand the basics of VUI design - Creating this skill will help you understand the basics of creating a working Voice User Interface (VUI) while using a cut/paste approach to development. You will learn by doing, and end up with a published Alexa skill. This tutorial includes instructions on how to customize the skill and submit for certification. For guidance on designing a voice experience with Alexa you can also watch this video.
  • Use JavaScript/Node.js and the Alexa Skills Kit to create a skill - You will use the template as a guide but the customization is up to you. For more background information on using the Alexa Skills Kit please watch this video.
  • Get your skill published - Once you have completed your skill, this tutorial will guide you through testing your skill and sending your skill through the certification process for making it available to be enabled by any Alexa user.
[Read More]

August 26, 2016

Michael Palermo

Today’s post comes from J. Michael Palermo IV, Sr. Evangelist at Amazon Alexa. In this post you’ll learn what directives are and how to develop a smart home skill adapter from scratch using Node.js.

Much of the heavy lifting for creating smart home skills happens before writing a line of code. In my last post, I walked you through the five  prerequisites to building a smart home skill. You may have noticed I left the code for the AWS Lambda function blank. In this post, you will start where that post ended. Not only will see how to manage the code workflow for a smart home skill adapter using Node.js, but you will also learn the fundamentals of the directive language, the communication protocol used between your skill adapter and the Smart Home Skill API.

Skill Adapter Directive Language

Before tackling any lines of code, you should understand the role of your skill adapter in the smart home skill process workflow. When the Alexa service understands the intent of a voice command to be smart home related, it continues processing through the Smart Home Skill API. The Smart Home Skill API service then communicates with a skill adapter using directive language, a JSON protocol structured to convey requests and responses. Each unique instance of a request or a response is known as a directive. All communications between your skill adapter and the Smart Home Skill API use the directive language. Your skill adapter receives requests as directives and is responsible for providing responses as directives.
 


Figure 1 : Directive Language

The structure of a directive involves two primary components, a header and a payload. While the payload varies in structure based on context, the header is fixed with just four fields defined here.

Table 1 : Directive header fields

Field

Value

messageId

A unique identifier (typically version 4 UUID) for each directive. Used for tracking/logging. Not to be used to support business logic.

name

The purpose of the directive, chosen from a predefined list of names. See Smart Home Skill API reference for supported directive names.

namespace

The category of the directive, such as  “Alexa.ConnectedHome.Discovery” or “Alexa.ConnectedHome.Control”

payloadVersion

The API version in use. The current version is “2”

Consider an example of an incoming directive from the Smart Home Skill API service to a skill adapter.

{

 "header" : {

  "messageId" : "6d6d6e14-8aee-473e-8c24-0d31ff9c17a2",

  "name" : "DiscoverAppliancesRequest",

  "namespace" : "Alexa.ConnectedHome.Discovery",

  "payloadVersion" : "2"

 },

 "payload" : {

  "accessToken" : "acc355t0ken"

 }

}

In the header, the namespace reveals the category of the directive is “Alexa.ConnectedHome.Discovery”, and the name “DiscoverAppliancesRequest” indicates a device discovery request is being made to a skill adapter. Because all smart home skill adapters require account linking at time of enablement, the payload will include the access token associated with the customer’s device cloud account. The value shown above is a mocked value used for testing purposes only. For more background about account linking and access tokens, please see this blog post.

[Read More]

August 24, 2016

David Isbitski

Before today, the Alexa Skills Kit enabled short audio via SSML audio tags on your skill responses. Today we are excited to announce that we have now added streaming audio support for Alexa skills including playback controls. This means you can easily create skills that playback audio content like podcasts, news stories, and live streams.

New AudioPlayer and PlaybackController interfaces provide directives and requests for streaming audio and monitoring playback progression. With this new feature, your skill can send audio directives to start and stop the playback. The Alexa service can provide your skill with information about the audio playback’s state, such as when the track is nearly finished, or when playback starts and stops. Alexa can also now send requests in response to hardware buttons, such as those on a remote control.

Enabling Audio Playback Support in Your Skill

To enable audio playback support in your skill you simply need to turn the Audio Player functionality on and handle the new audio Intents. Navigate to the Alexa developer portal and do the following:

  • On the Skill Information page in the developer portal, set the Audio Player option to Yes.
     
  • Include the required built-in intents for pausing and resuming audio in your intent schema and implement them in some way:
    • AMAZON.PauseIntent
    • AMAZON.ResumeIntent
       
  • Call the AudioPlayer.Play Directive from one of your Intents to start the Audio Playback
     
  • Handle AudioPlayer and PlaybackController Requests and optionally respond

In addition to the required built-in intents, your skill should gracefully handle the following additional built-in intents:
 

  • AMAZON.CancelIntent
  • AMAZON.LoopOffIntent
  • AMAZON.LoopOnIntent
  • AMAZON.NextIntent
  • AMAZON.PreviousIntent
  • AMAZON.RepeatIntent
  • AMAZON.ShuffleOffIntent
  • AMAZON.ShuffleOnIntent
  • AMAZON.StartOverIntent

Note: Users can invoke these built-in intents without using your skill’s invocation name. For example, while in a podcast skill you create, a user could say “Alexa Next” and your skill would play the next episode.

If your skill is currently playing audio, or was the skill most recently playing audio, these intents are automatically sent to your skill. Your code needs to expect them and not return an error. If any of these intents does not apply to your skill, handle it in an appropriate  way in your code. For instance, you could return a response with text-to-speech indicating that the command is not relevant to the skill. The specific message depends on the skill and whether the intent is one that might make sense at some point, for example:
 

  • For a podcast skill, the AMAZON.ShuffleOnIntent intent might return the message: “I can’t shuffle a podcast.”
  • For version 1.0 of a music skill that doesn’t yet support playlists and shuffling, the AMAZON.ShuffleOnIntent intent might return: “Sorry, I can’t shuffle music yet.”


Note: If your skill uses the AudioPlayer directives, you cannot extend the above built-in intents with your own sample utterances.

[Read More]

Want the latest?

alexa topics

Recent Posts

Archive