Alexa-Lambda-Kegbot is an Alexa Skill for communication with your Kegbot. Currently it supports questions the following:
- What's on tap?
- How much is left?
- Who has been drinking recently?
See intent_schema.json for all the sample utterances.
- node - NodeJS http://nodejs.org
- AWS account with a connection to your Kegbot server to run the lambda
- AWS Developer account from https://developer.amazon.com to create skill
- Setup a new custom Alexa Skill on https://developer.amazon.com/alexa/console/ask/create-new-skill
- Login
- Enter a Skill Name
- Select a language, although a lot of this is english...
- Choose Custom model
- Choose "Provision your own" method of hosting
- Click "Create Skill"
- Select the "Start from scratch" template
- Click "Choose"
- Go to the "JSON Editor" in the left nav
- Drag and drop a .json file, or click it and upload intent_schema.json
- Click "Build Model"
- Click "Your Skills" to return to the skill listing
- Click on "View Skill ID" under your Skill Name
- Save the Alexa Skill ID We'll come back to this later
- Grab the code:
- Clone Repo:
git clone https://github.com/patfreeman/alexa-lambda-kegbot.git
cd alexa-lambda-kegbot
npm install
cp config/default_example.js config/default.js
vi config/default.js
- Set your Kegbot configuration. Protocol, host, port, API key (if required)
zip -r ../alk.zip .
NOTE: Make sure you are in the directory with the index.js file.
- Clone Repo:
- Create Lambda
- In the AWS Lambda console https://console.aws.amazon.com/lambda/home?region=us-east-1#/
- Create a Lambda Function in us-east-1
- Choose "Author from scratch"
- Name - Give it a name
- Runtime - Choose Node.js 12.x
- Role - Choose a role or create a new one from templates(s)
- Role name - Enter if required
- Policy templates - leave blank
- Click "Create Function"
- Configure the Lambda Function
- Under Function code, change Code entry type to Upload a .zip file
- Click "Upload" and select the ZIP you created above
- Defaults on everything else should be good enough.
- Handler needs to stay as index.handler
- Environment variables - leave blank because we don't need any
- Tags - leave blank, or don't. that's up to you
- Description - if you care
- Memory - 128MB is more than enough
- Timeout - Set this to 10s
- Network - Leave as "No VPC" or if you know you need it, then you probably don't need these step by step instructions.
- Concurrency - Use unreserved account concurrency
- etc ...
- Click "Save" in the top-right corner of the screen.
- Add Alexa Skill Trigger
- Expand the Lambda Designer window
- Under Add triggers, select Alexa Skills Kit
- Paste in the Alexa Skill ID you saved from above
- Click Add
- Test your Lambda Function
- Select "Select a test event..." in the drop-down in the top-right corner
- Select "Configure test events"
- Give the test a name
- Paste in the code in the alexa_test_script.json file
- Click Create
- Click "Test"
- You should see success and the JSON response should show what is on tap on your kegbot
- Note ARN in upper right corner
- Finalize Setup
- Go back to Alexa Skill setup on https://developer.amazon.com/alexa/console/ask
- Select the Alexa Skill you created earlier
- Under Endpoint
- Choose AWS Lambda ARN
- Paste the ARN for your Lambda created above under Default Region
- Click "Save Endpoint"
- Test
- Click on the Test Tab
- Click the switch to enable Testing
- Type in phrases (or speak them) into the test interface.
- "ask keg bot what is on tap"
- "ask keg bot how much beer is left"
- Replace "keg bot" with your Invocation phrase you configured earlier
- Try talking to Alexa