Skip to content

00mjk/aws_alexa_comcast_data_usage_lambda

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An Amazon Alexa skill for getting your comcast internet usage using Python for AWS Lambda

Installation

git clone git@github.com:kfowlks/aws_alexa_comcast_data_usage_lambda.git

cd aws_alexa_comcast_data_usage_lambda

pip install requests -t <path to this project>/aws_alexa_comcast_data_usage_lambda

git clone https://github.com/anjishnu/ask-alexa-pykit.git

cd ask-alexa-pykit

git checkout python_lambda_0.5_release 

cp -R ask <path to this project>/aws_alexa_comcast_data_usage_lambda

cd <path to this project>/aws_alexa_comcast_data_usage_lambda

You'll need to contruct a zip file that contains all code and external libraries.

zip -r ask-alexa_comcast_data_usage_lambda.zip *

In the AWS Lambda console you need to do the below

Create a blank AWS Lambda function, be sure to select Alexa as the trigger

upload zip file i.e. ask-alexa_comcast_data_usage_lambda.zip

You'll need to set the below Environment variables in your AWS Lambda console

COMCAST_USERNAME
COMCAST_PASSWORD

You'll need to configure the AWS Alexa skill console and follow the steps to create a skill. You will find the intent scheme and the utterance text under Test Data

###Testing

In the AWS Lambda console you'll need to select the new function and configure the below test request.

Actions->Configure test event

{
  "session": {
    "sessionId": "SessionId.9da74599-e9d0-4d7e-ad2f-fc3369e79614",
    "application": {
      "applicationId": "amzn1.ask.skill.[unique id]"
    },
    "attributes": {},
    "user": {
      "userId": "amzn1.ask.account.[unique id]"
    },
    "new": true
  },
  "request": {
    "type": "IntentRequest",
    "requestId": "EdwRequestId.[unique id]",
    "locale": "en-US",
    "timestamp": "2016-12-12T01:09:50Z",
    "intent": {
      "name": "GetInternetUsage",
      "slots": {
        "Date": {
          "name": "Date",
          "value": "2016-12-12"
        }
      }
    }
  },
  "version": "1.0"
}

If everything worked, you'll see a response like the below.

{
  "version": "1.0",
  "response": {
    "outputSpeech": {
      "text": "You have used 325.0GB out of 1024.0GB for the month of December!",
      "type": "PlainText"
    },
    "shouldEndSession": false
  },
  "sessionAttributes": {}
}

###Requires

  • Python 2.7+

Version

0.0.1

Travis build status

About

Amazon Alexa skill for getting your comcast internet usage

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 84.1%
  • Shell 15.9%