Extending Amazon Echo with IFTTT
A few weeks ago, we received an Amazon Echo at our office. We were one of the lucky few that put in an order early enough to get one in April. After testing it a bit at the office, one of our fellow team members decided to take it home to put it through its paces, and throw it into the mix of other connected devices.
By then, the Echo had expanded to include integrations with WeMo and Philips Hue, which was easy to set up, and immediately useful. Not only was more music being played in the home, but also a wider variety. For some reason, the ability to use voice commands seemed to lower a barrier that exists with touching glass. So much so, that the 2-year-old daughter was telling Alexa to “stop” if a song she didn’t like was playing.
Shortly after these new integrations, Amazon added another one: IFTTT. With IFTTT, it seemed as though a world of additional possibilities to perform a variety of actions would open up. We would be able to “send an email”, “post a tweet”, “set the thermostat to 70 degrees” and more. Or, that was the hope, but we never verified that.
Flash forward to a tweet that was sent out referencing that 2-year-old learning how to tell Alexa what to do, a response from Amazon Help and further conversation over Twitter:
@juansanchez If only Alexa could pour chocolate milk... ◉o◉ ^EN— Amazon Help (@AmazonHelp) May 8, 2015
@AmazonHelp With @IFTTT and @littleBits it’s certainly possible. Maybe a fun weekend project ;-)— Juan Sanchez (@juansanchez) May 8, 2015
We always love excuses to dig into new technologies, especially ones we’re interested in. A proof-of-concept of pouring milk would be easy, so we thought.
Testing Our Theory
Unfortunately, at the outset, IFTTT only works with the Echo’s To Dos and Shopping List. Of course, this didn’t stop people from trying to get it to work by using the “New item added to my To Do list” trigger for the Echo to perform an action. The problem is that the trigger would fire any time something was added to the To Do list.
We thought for a quick example, we could take the same approach, but it seemed like a limited solution. There had to be a better way. If only we could get the actual text from the To Do, maybe we could perform a specific action and a wider variety of them.
As it turns out, every new To Do that’s created does carry the text from the Alexa command along with it. However, you can’t use it directly from the IFTTT trigger, so we came up with a hack.
We set up a Gmail account that is used only for commands that come from the Amazon Alexa channel. We created an IFTTT recipe that sends any newly created To Do to that Gmail account. That text is now in another command that we can do something with.
Then, for every different type of command we may want to act on, we create another IFTTT recipe. We create a Gmail trigger for any new email that matches a particular search. In this case, we put quotes around our command. For example, “water the garden”, “tweet”, etc. For each command that matches you just need to supply an action. So, for “water the garden” you can select the Rachio channel and select a zone, or choose any other channel that can execute your command.
Queueing New Commands
For any new commands that you’d like to respond to, you just need to create a recipe that uses the Gmail search trigger and other channel action. It’s quick and easy, and it works! However, as with any hack, there are downsides:
- With email on IFTTT, there can be a 15 minute delay from when Alexa records that new To Do item.
- If you’re sending text, for something like a new tweet, the entire To Do item text will get sent along. There’s no way to parse it out.
Once you get a command all set up, you can say something like, “Alexa, new to do. Water the garden”, and your command is now in the queue to run. For the downsides mentioned above, you may want to stick to commands that aren’t time-sensitive. It’s up to you! Maybe consider the queue as something Alexa will get to when she has a spare moment.
Here are some other ideas:
Daily Journal: [today] your message => Append to document using Google Drive
Water a Zone: [water the garden] => Water a zone using Rachio Iro
Queue a Phone Call: I’d like to [call mom] today => Get a push notification that launches a phone call using Launch Center
Email Someone: [name] your message => Email someone using Gmail
Post a Tweet: [tweet] your message => Post a tweet
Log an Issue: [repository name issue] the issue => Log issue on Github repository
Heat the House: [it’s cold in here] => Turn your Nest thermostat to a preset warmer temperature
Feed My Fish: [feed my fish] => Activate a littleBits invention
Oh, and as for Alexa pouring a cup of chocolate milk, well, here it is (with that IFTTT delay):
Just a Hack for Now
Having a hub to control many of the things we interact with on a daily basis via voice is pretty exciting. Of course, having access to the Alexa AppKit would be ideal, but using IFTTT provides a somewhat accessible way to do things now. Maybe you’ll be able to access Alexa’s commands as an IFTTT trigger in the future.