Create an account on “Serverless Function, FaaS Serverless - AWS Lambda - AWS”
Under AWS Service in the Compute category select Lambda
Then Create a new Lambda function
Select a blueprint
In filter search for “alexa-skills-kit-color-expert” nodejs
It should then bring you to configure triggers
Click the box outlined with dashes and from the drop down select Alexa Skills Kit
Than name your function and enter a description
For the runtime select NodeJS (do not select node.js4.3)
Edit inline code and delete everything there then past the code below
You will need to come back to this to update the application ID and your IP address once your skill is setup
var http = require('http'); var URLParser = require('url'); exports.handler = function (json, context) { try { // A list of URL's to call for each applicationId var handlers = { 'appId':'url', 'amzn1.ask.skill.xxxx-xxxx-xxxx-xxxx-xxxxxx':' http://xxxxxxxx:8123/api/alexa?api_password=password }; // Look up the url to call based on the appId var url = handlers[json.session.application.applicationId]; if (!url) { context.fail("No url found for application id"); } var parts = URLParser.parse(url); var post_data = JSON.stringify(json); // An object of options to indicate where to post to var post_options = { host: parts.hostname, auth: parts.auth, port: (parts.port || 80), path: parts.path, method: 'POST', headers: { 'Content-Type': 'application/json', 'Content-Length': post_data.length } }; // Initiate the request to the HTTP endpoint var req = http.request(post_options,function(res) { var body = ""; // Data may be chunked res.on('data', function(chunk) { body += chunk; }); res.on('end', function() { // When data is done, finish the request context.succeed(JSON.parse(body)); }); }); req.on('error', function(e) { context.fail('problem with request: ' + e.message); }); // Send the JSON data req.write(post_data); req.end(); } catch (e) { context.fail("Exception: " + e); } };
I was able to use this which I found as a part of an Alexa Nest integration Here
Leave handler as index.handler
Role: Choose Existing Role
Existing Role: Lambda_Basic_Execution
Memory 128
Timeout set to 10 Seconds
No VPC
Then hit Next
Then Create Function
On the next page at the top right you will see ARN
arn:aws:lambda:location:XXXXXXXXXXXXXXXXXXXXX:function:name
Copy this as you will need it to create your alexa skill
Next go to and create an account or sign in if you already have one
“https://developer.amazon.com/”
Click the Alexa tab
Alexa Skills Kit> Get Started
Add New Skill
Radio button custom interaction model should be selected
Give your skill an name
Then also the name you will use to activate your skill “Alexa ask ‘Skill Name’ to turn on the lights” and click next.
The interaction model you will need HA intents and sample utterance examples and detail
Home Assistant
Once done hit next
Click the AWS Lambda ARN
In my case I chose north america
Now you need to paste the ARN that was copied earlier from you lambda function.
Then hit next
at the top under the name of your skill you will see that you have an ID for you application similar to:
amzn1.ask.skill.xxxxxxx-xxxxx-xxxxx-xxxxxxxxx-xxxxxxxxx
Copy this and go back to your lambda function and to the code section
Paste your ID as a replacement for what is in the code and make sure that your outward facing IP is entered and the port that points back to you HA instance.
So long as you’ve configured your Yaml based on the HA documentation you should be all set.
This is a quick and dirty run through of what I was able to use to get my skill functioning it took me way too long to cobble it together so hopefully this will help someone.