Giter Club home page Giter Club logo

alexa-lambda-kegbot's Introduction

Alexa-Lambda-Kegbot

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.

Requirements

Setup

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.