This is a side project to set the mood using my Alexa.
- Log into the AWS management Console. Create an account if you need to.
- From the list of services, select Lambda
- Set your region to US East (N. Virginia)
- Choose Create a Lambda Function
- In the search filter box, type Alexa
- Select blueprint alexa-skills-kit-color-expert-python
- Name your function. I call mine logWeight
- Under Lambda function handler and role, select Create a custom role.
- When the IAM role management console opens, choose Allow to go back to the previous Lambda console.
- The role should read
lambda_basic_execution
. - In your IAM roles attach the AWSLambdaFullAccess policy to your role.
- Add environment variables. These give you access to Spotify. Note that the Alexa application id and the Alexa test application id are filtered.
- SPOTIPY_CLIENT_ID
- SPOTIPY_CLIENT_SECRET
- SPOTIPY_REDIRECT_URI
- SPOTIPY_SCOPE
- SPOTIPY_TOKEN_INFO
- ALEXA_APPLICATION_ID
- ALEXA_TEST_APPLICATION_ID
- SPOTIPY_DEVICE_ID
- SPOTIPY_CONTEXT_URI
- IFTTT_URI
- Sign into the Amazon Developer Portal.
- Select Alexa
- Under Alexa Skills Kit, choose Get Started
- Choose Add a New Skill
- Name your skill. It doesn’t really matter what it is.
- Create an invocation name. I set it to "set the mood" Note that there are limits to how you can invoke this skill. For example, you cannot (unfortunately) say “Alexa, I weigh 165 pounds”.
- Choose Next
- In the Intent Schema box, paste the following JSON code
{
"intents": [
{
"intent": "SetTheMood"
},
{
"intent": "AMAZON.HelpIntent"
}
]
}
- Under the Sample Utterances enter
SetTheMood set the mood
- Choose Next
- Select the Endpoint AWS Lambda ARN then paste your ARN code from step 1-14. Select North America as your region, and for Account Linking select No, then choose Next.
- AWS Lambda requires all python packages to be at the root file level.
- While within the project directory you can call
./install.sh
to install all of the requirements. - Zip up all of the files by running
zip -r -X lambdaD.zip .
- Then upload the zipfile to your lambda function