AWS Alexa Smart Home Skill: introduction and startup – 1
I bought an Alexa device and since then I don’t want to press a button anymore and I want to turn all my devices into voice control. If my internet connection stop to work I don’t exist anymore.
But after I this disclaimer I’d like to start to help you to connect your custom device to your personal AWS account.For this part I will refer to an old existing tutorial given but not updated from Amazon.
First we must understand wicth parts we are going to examine in this project.
We’re going to create our own Alexa SmartHome Skill to interact with Alexa, then store the information on DynamoDB.
You must know that a Smart Home Skill is different from a Skill, the main difference is that it is not necessary to open the Skill to work, you can directly execute the command (like “Alexa turn on the light”) but as you can understand you have some limitations, the first is that you can only use a set of commands specified by an interface.
And some generic controller
There are other 2 set of interface, but we don’t read about that now.
You must create the accounts.
- An Amazon Developer account. This is required to create and configure Alexa skills.
- An Amazon Web Services (AWS) account. This is required to host the skill logic in an AWS Lambda function.
First create a folder, for me I create
setup-template.txt file from
and rename in
The file should contain:
[Login with Amazon Client ID] amzn1.application-oa2-client.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX [Login with Amazon Client Secret] XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX [Alexa Skill Application ID] amzn1.ask.skill.XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX [AWS Lambda ARN] arn:aws:lambda:us-east-1:XXXXXXXXXXXX:function:skill-sample-language-smarthome-switch [Redirect URLs] https://pitangui.amazon.com/api/skill/link/XXXXXXXXXXXXXX https://layla.amazon.com/api/skill/link/XXXXXXXXXXXXXX https://alexa.amazon.co.jp/api/skill/link/XXXXXXXXXXXXXX [DynamoDB table] XXXXXXX [Device end point] XXXXXXXX
Install Optional Tools
The use of these tools is optional as they are useful, but not required.
You can directly write code on AWS, but It’s better if you download NodeJS.
Git 2.0 or greater is required only if you want to clone the source code locally. At a command line, you can verify if git is installed by running the command:
If it is not properly installed or is not a version greater than 2.0, visit https://git-scm.com/downloads to download and install a version for your platform.
This ASK CLI can be used to create, deploy, and maintain a Alexa skills. If you have the ASK CLI installed already you can can verify its version by running the command:
For the purposes of this sample, the ask version should be 1.3.1 or greater.
Get the Source Code via Git
If you have git installed on your workstation, you can use the following instructions to pull the source code into your working directory.
- From the command-line, navigate into the working directory on your desktop:
- Run the following command to pull the source code to a working directory:
git clone https://github.com/xreef/alexa-skill-manage-relay-nodejs.git
If you do not have git installed, download and unzip the zipped contents of the sample from https://github.com/xreef/alexa-skill-manage-relay-nodejs/archive/master.zip into your desktop working directory:
- AWS Alexa Smart Home Skill: introduction and startup
- AWS Alexa Smart Home Skill: create the skill manage the security
- AWS Alexa Smart Home Skill: create lambda and manage security
- AWS Alexa Smart Home Skill: configure lambda for the skill
- AWS Alexa Smart Home Skill: setup the DynamoDB database
- AWS Alexa Smart Home Skill: load sample code and test Lambda
- AWS Alexa Smart Home Skill: test your skill in dev and manage log