After discovering our minor setback in my last post, I had to find a way to get Alexa to notify the mirror application when a command was issued (or a question was asked), without using the Java Client.
Turns out you can add your own extra “skills” to Alexa. What Amazon calls a “Skill” is extra functionality you can write yourself, and add to the portfolio of Alexa commands you can ask the mirror. In order to do that we need to get an account to the Amazon Web Services (AWS).
You can register for this using your developer account at the URL below.
Aws offers a broad range of online services, some of which are free, and some of which are priced.
From the Aws portal site you can create a free account. You can sign up for it at the top right of the window.
Doing so is quite a straight forward process. You have to supply your name, email, etc. But you also have to enter your credit card number.
Even though we will be using the so called “Free Tier” of AWS (services that aren’t charged for) you have to enter a valid credit card number.
It’s also important you enter a correct phone number. In order to verify your identity Amazon calls you when finishing up the sign up process. It is an automated voice controlled computer asking you to enter a pin number. After completing the process you can access the services from the Aws Portal.
The service we’ll need to add extra skills to our mirror is called Aws Lambda.
Using the lambda services you get server time on one of the servers of Amazon, executing that piece of code every time you ask it to. Simple as that. The service is free… at least, almost free. You get 1.000.000 free calls per month. That’s one million. 1 with six zeroes. That’s a whole lotta command to ask the mirror in one month. Basically, it means: free.
You can find some more extra free features at this URL : https://aws.amazon.com/free/
Extra storage, computing time and database hosting, basically for free. Some paying services are free up to 12 months.
A second service we will be using is the DynamoDB service. This is a service which is also included in the “Free” tier. The screenshot below shows the details.
According to me, quite enough to handle our requests. So basically : free. That’s great.
My intention is fairly simple. I will be writing the details of the commands to a table in DynamoDB, in some sort of queue. This queue can then be polled by the mirror. Furthermore, I will be able to maintain a log of all queries, and some stats on the mirror. These are some nice extra perks.
Someone on the Magic Mirror portal also pointed me towards a solution somebody else made using the AWS IoT service (Internet of Things), in which I would have to register the Raspberry Pi as a device to be addressed in order to execute commands I send it. In the end it would probably be a good solution, but when browsing the pricing model I saw it was free up until 12 months. According to not a durable solution, so I’m going for the DynamoDB solution because it provides me with more extensive features, and can plug in to my existing architecture.
Let’s get cracking!