Name: skill-sample-nodejs-buttons-hellobuttons
Owner: Alexa
Description: Hello World buttons skill opens with buttons roll call and asks the user to push two buttons. On button one press, she changes the color to red and on button two press she changes the color to blue. Then closes. This skill demonstrates how to send directives to, and receive events from, Echo Buttons.
Created: 2018-03-06 21:30:50.0
Updated: 2018-05-21 02:02:34.0
Pushed: 2018-05-21 02:02:33.0
Homepage: null
Size: 28
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Important: The Gadgets Skill API is in beta and is subject to change at any time without notice. We welcome your feedback.
These instructions show how to create a simple skill called Hello Buttons. This skill demonstrates how to send directives to, and receive events from, Echo Buttons.
Note: Hello Buttons demonstrates how to use the Gadget interfaces (GameEngine and GadgetController). It is not intended to be a comprehensive example. For an end-to-end skill, please refer to the Color Changer skill in the Alexa Github.
This sample skill uses:
When the Hello Buttons skill begins, it will send animation directives for the three possible trigger events (buttonDown
, buttonUp
and none
) to all the Echo Buttons. Alexa will then ask you to press the buttons, and an audio file will play.
When you press a button, the skill will interrupt Alexa's speech. If the button that you pressed is not awake, the skill will initialize the button by sending animation directives for buttonDown
, buttonUp
and none
to that button. This is different from the original LaunchRequest
intent, which sent initialization directives to all buttons.
If the pressed button wakes up, you will see a different color on buttonDown
and buttonUp
events, as well as a breathing animation for the none
event. If you cancel the skill (for example, by saying “Alexa, cancel”) or the Input Handler expires, the buttons will fade from white to black.
Before you create the Hello Buttons skill, you must take the following steps:
Create an Amazon developer account If you don't already have an Amazon developer account, go to the developer portal and select Sign In in the upper right to create a free account.
Sign up for AWS If you haven't already, sign up for AWS by going to AWS Free Tier. For most developers, the AWS Lambda Free Tier is sufficient for the function that supports an Alexa skill.
Get Echo Buttons This skill requires two Echo Buttons.
t clone https://github.com/alexa/skill-sample-nodejs-buttons-hellobuttons/
npm install
from the directory of the repo you just cloned in the previous step. skill-sample-nodejs-buttons-hellobuttons
m install
p -r -X ../HelloButtonsDeploymentPackage.zip *
In this step, you upload create an archive of the skill code and supporting modules and upload the archive to AWS Lambda. Later, when you set up the skill in the developer portal, you will specify that this function is the endpoint for the skill.
HelloButtons
.HelloButtonsRole
.HelloButtonsDeploymentPackage.zip
file.In this step, you find the Amazon Resource Name (ARN) of the Lambda function that you just created. The ARN serves as the ID of the function. You can find the ARN at the top right of the Hello Buttons function page in the AWS Lambda console. The ARN will look something
like arn:aws:lambda:us-east-1:012345678910:function:HelloButtons
.
Copy the ARN. Later, when you set up the Hello Buttons skill in the developer portal, you will provide this ARN as the endpoint for the skill.
Next, create the skill in the developer console by using the following steps:
Important: If you get an 'unspecified error' when performing any of the remaining steps, try logging out and then logging back in to the developer console.
Continuing from the previous step, do the following:
hello buttons
, and then select Save Model.LaunchIntent
, and then select Create custom intent.Open Hello Buttons
Continuing from the previous step, do the following:
Continuing from the previous step, do the following:
Continuing from the previous step, do the following:
This is a sample skill for Echo Buttons.
Alexa, open Hello Buttons
.Continuing from the previous step, do the following:
None
.Your Hello Buttons skill is in the development state and available for you to test with your Amazon Echo device and your Echo Buttons. First, you must ensure that the skill is enabled in the Alexa app. To check this, do the following:
Pair your Echo Buttons to your Amazon Echo device, and then invoke the Hello Buttons skill by saying “Alexa, open Hello Buttons“. The skill should run as described in the skill flow.
This library is licensed under the Amazon Software License.