Name: skill-sample-nodejs-buttons-colorchanger
Owner: Alexa
Description: Color Changer buttons skill opens with buttons roll call and asks the user to push buttons to change their colors with various animations. It covers roll call, starting and stopping the Input Handler, and defining animations for different button events. It also demonstrates how Echo Buttons can interrupt text-to-speech (TTS).
Created: 2018-03-06 21:28:34.0
Updated: 2018-05-17 16:54:55.0
Pushed: 2018-05-17 16:54:53.0
Homepage: null
Size: 30
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 skill called Color Changer, which demonstrates the core functionality of an Echo Button skill. It covers roll call, starting and stopping the Input Handler, and defining animations for different button events. It also demonstrates how Echo Buttons can interrupt text-to-speech (TTS).
This sample skill uses:
When the Color Changer skill begins, Alexa will ask you to press the Echo Buttons that you want to use. This is called roll call. After you press the buttons, Alexa will ask you to select a color: red, blue, or green. When you select a color, the skill will send animation directives to all the Echo Buttons. Once you have selected your color, Alexa will ask you to press the buttons. When you press a button, the skill will interrupt Alexa's speech and change the button's LED color to the color that you selected previously.
Click on the following diagram to see a voice user interface (VUI) that shows how a user interacts with the skill. To zoom in, click on the diagram again when it opens in the browser window.
Before you create the Color Changer skill, you must take the following steps:
In this step, you will get a copy of the sample skill code on your local computer and prepare a deployment package (a zip file that you create out of the Color Changer skill code) to upload to Lambda in the next step.
npm install
in the skill-sample-nodejs-buttons-colorchanger/lambda/custom folder to download and install the NodeJS package dependencies that this skill uses such as the Alexa SDK. NPM will be available on your computer if you have NodeJS installed (see the Preparation step above).In this step, you upload the deployment package 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.
sion": "2012-10-17",
tement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:PutLogEvents",
"logs:CreateLogStream",
"iam:GetRole",
"iam:ListRoles",
"dynamodb:GetItem",
"dynamodb:PutItem",
"dynamodb:DeleteItem",
"dynamodb:Scan",
"dynamodb:Query",
"dynamodb:UpdateItem",
"dynamodb:CreateTable",
"dynamodb:DescribeTable"
],
"Resource": "*"
}
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 Color Changer function page in the AWS Lambda console. The ARN will look something like arn:aws:lambda:us-east-1:012345678910:function:ColorChanger
.
Copy the ARN. Later, when you set up the Color Changer 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:
color changer
, and then select Save Model.yes
. The search results should come up with AMAZON.YesIntent
.AMAZON.YesIntent
, select Add Intent.AMAZON.NoIntent
.COLORS
, and then select Create custom slot type.green
, and then, on the right side of the text field, select the + sign.red
and blue
also. Do not save the model yet; it might return an error.colorIntent
, and then select Create custom intent.color
and then, to the right of the name, select the + sign.{
(that is, a left brace), select color, and then select the + sign.I like {
, select color, and then select the + sign.Let's go with {
, select color, and then select the + sign.How about {
, select color, and then select the + sign.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 Color Changer
.Continuing from the previous step, do the following:
For Does this skill allow users to make purchases or spend real money?, select No.
For Does this Alexa skill collect users' personal information?, select No.
For Is this skill directed to or does it target children under the age of 13?, select No.
For Does this skill contain advertising? select No.
For Export Compliance, select the checkbox.
For Testing Instructions, enter None
.
At the bottom of the page, select Save and continue.
Again, select Save and continue. This will accept the default options on the Availability page.
You should now be on the Submission page, which will tell you that fixes are required (to add icons). You don't need to add icons now because you can test the skill without submitting it for certification.
Your Color Changer 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 skill by saying “Alexa, open Color Changer“. The skill should run as described in the skill flow.
This library is licensed under the Amazon Software License.