I have now found a solution that is free, reliable, and very flexible. This is done by writing an Alexa Skill that adds a message to a cloud hosted queue based on your voice command. The Raspberry Pi repeatedly checks this queue for new messages, and runs customizable behaviour based on message contents. This is not limited to smart mirror applications, or Raspberry Pis. It can be used to launch any script you want on any platform that will connect to Amazon's SQS.
Here is a demonstration, and high level overview of how it works:
and a follow up demonstrating an extension of this idea:
In this tutorial I will focus on just using this to simply turn the smart mirror on and off. Adding your own scripts should then be fairly straight forward,
The steps will be as follows:
- Create a Queue using the Amazon Simple Queue Service (SQS)
- Write some python code to read and write to this queue
- Write a Lambda Function that posts messages to the queue
- Write an Alexa Skill that calls the Lambda Function
- Schedule a task on your Raspberry Pi to read queue messages and take appropriate action.