An AWS Lambda function of an Alexa skill for taking notes. It saves your notes in DynamoDB, so your notes can be read out or deleted later. The Alexa responses used Speech Synthesis Markup Language (SSML) for richer audio effect.
However, to get it to work with your Magic Mirror Module - Note Taker, you have to use your own DynamoDB, so you still have to create your own Lambda function & Alexa skill by following the instructions below.
User: "Alexa, ask Note Taker to take my note lunch with Linda at Maru tomorrow"
Alexa: "Dun dun dun. I have taken a new note. Your third note is lunch with Linda at Maru tomorrow"
User: "Alexa, ask Note Taker to read my notes"
Alexa: "As you wish. You have the following notes: ......"
User: "Alexa, ask Note Taker to read note number three"
Alexa: "Aha! Your third note is lunch with Linda at Maru tomorrow"
User: "Alexa, ask Note Taker to delete note number three"
Alexa: "Good riddance. Your third note, lunch with Linda at Maru tomorrow is deleted"
User: "Alexa, ask Note Taker to delete my notes"
Alexa: "Yay! All of your notes are deleted."
- hello
- hi
- how are you
- take my note {asymmetric cryptography uses public and private keys to encrypt and decrypt data}
- take a note {dinner with Linda at six tomorrow at Hao}
- take note {interactive orange juice}
- read all my notes
- read all notes
- read my notes
- read notes
Note: readIndex has to be a cardinal number, not an ordinal number
- read my note number {readIndex}
- read note number {readIndex}
- read number {readIndex}
- read note {readIndex}
- what's my note number {readIndex}
- what's note number {readIndex}
- delete all my notes
- delete all notes
- delete my notes
- delete all
Note: deleteIndex has to be a cardinal number, not an ordinal number
- delete note number {deleteIndex}
- delete my note number {deleteIndex}
- delete number {deleteIndex}
- delete note {deleteIndex}
Note: This is only for the use of the Magic Mirror Module Note Taker. Your user ID will be displayed on your Alexa companion mobile app or on the Alexa website
- what's my database user ID
- what's my user ID
- what's my user identifier
- what's my identifier
- my user ID
- my identifier
On your terminal, navigate to the src folder, and enter npm install
to install dependencies.
To run this skill you need to do two things:
- deploy the code in Lambda
- configure the Alexa skill to use Lambda
- Go to the AWS Console and click on the Lambda link. Note: ensure you are in us-east or you won't be able to use Alexa with Lambda.
- Click on the Create a Lambda Function or Get Started Now button.
- Choose Blank Blueprint
- Choose trigger Alexa Skills Kit, click "Next"
- Name the Lambda Function, select the runtime as Node.js
- Go to your local src directory, select all files and then create a zip file, make sure the zip file does not contain the src directory itself, otherwise Lambda function will not work.
- Go back to the AWS Lambda console, select Code entry type as "Upload a .ZIP file" and then upload the .zip file to the Lambda
- Keep the Handler as index.handler (this refers to the main js file in the zip)
- Create a new role for full access of DynamoDB:
- Go to the IAM service from the AWS Console
- Click on Roles, then Create New Role
- Call this Role lambda-dynamo-full-access-role
- Select AWS Lambda as the Role Type
- Select policies AmazonDynamoDBFullAccess and CloudWatchFullAccess (for debug)
- Click Next, then Create Role
- Go back to the Lambda console, Choose an existing role
- Choose lambda-dynamo-full-access-role
- Leave the Advanced settings as the defaults
- Click "Next" and review the settings then click "Create Function"
- Copy the ARN from the top right to be used later in the Alexa Skill Setup
- Go to the Alexa Console and click Add a New Skill.
- Set "Mirror Mirror On The Wall" as the skill name and "on the wall" as the invocation name, this is what is used to activate your skill. For example you would say: "Alexa, on the wall, say hello". If you customized the wake word as "Mirror mirror", you can say "Mirror mirror on the wall, find Snow White".
- Select the Lambda ARN for the skill Endpoint and paste the ARN copied from above. Click Next.
- Copy the Intent Schema from the included IntentSchema.json in the speechAssets folder.
- Copy the Sample Utterances from the included SampleUtterances.txt. Click Next.
- Go back to the skill Information tab and copy the appId. Paste the appId into the index.js file for the variable APP_ID, then update the Lambda source zip file with this change and upload to Lambda again, this step makes sure the Lambda function only serves request from authorized source.
- You are now able to start testing your Alexa skill! You should be able to go to the Echo webpage and see your skill enabled.
- In order to test it, try to say some of the Sample Utterances from the List of commands section above.