I have an Iris system from Lowes. Overall I love the system. I’ve had it for years, and have built it up over time. It has its limitations though. Mainly that they haven’t really opened it up for developers to do neat integrations with it. There’s no official API support, or IFTTT integration. If you stick with what they’ve provided then you’re kinda limited in what you can do. So, for example, if you want to be able to turn off all the lights in your house with your Pebble watch there’s no straight path.
Recently I purchased an Amazon Echo. I love it. Keeping it in my kitchen has made keeping track of shopping items, timers in cooking, and to-do items much more efficient. The one thing it was missing was Iris integration. Alexa integrates with many other home automation systems, but not Iris. Amazon, however, has a whole Skills Development Kit for developers to dig in and make Alexa do whatever they want. So, thanks to a discovered API for Iris, and Amazon’s Alexa Skill Kit, we can bridge the gap and bring Iris integration to Alexa.
Setting up your Alexa environment
First and foremost you’ll want to head on over to The Amazon Developer Console and sign up for an account. You can use your existing Amazon account assuming you have one. Here you’ll be making your skills and learning how to use the Skills Kit for Alexa. While you’re at it go over to The Amazon AWS Management Console and take care of business there as well. Amazon recommends, and I agree, that you use their Lambda service to host your skills. That’s an AWS product.
Iris, AlertMe v5, and Living with Iris
Lowes does not officially support any API and no documentation is available from them. Luckily their API was found and posted to the Living with Iris forum here. The API documentation is available as a download on that forum post (you’ll need to sign up for an account with the forum to download files). Side note that forum is an invaluable resource for Iris hacks and tricks. Through that site you can figure out how to do anything with your Iris system.
Let’s get down to it.
All this does is pull in our code set in IrisSkill.js. The other major departure is the Intents.
I’m passing response along for Alexa to say something when our request is done. Other than those two differences index.js is largely the same as the Amazon provided examples. Feel free to download and review their examples, they’re great.
Anyway moving on to IrisSkill.js. This was my first time working with Node.js so my code is probably not great, but it works. Instead of disecting it piece by piece I’ll just put it all out there. Here you go!
The important things here that aren’t completely obvious (like setting your USERNAME and PASSWORD) are where to set your actions. The post_data, path, method, and headers are all very important. Depending on what you’re trying to do, each one will change. The login request, for example, is setup this way:
But to set your Home mode that looks like this:
The post_data seems like an obvious thing to change, the POST seems like it would’ve been appropriate for each request, right? Well, I guess, but PUT makes sense for changing the Home mode. The AlertMe documentation linked on Living with Iris outlines what each type of action requires. Each type of request will go to a different path. Of note is also how the session cookie is pushed along. That was kinda weird and it took me a while to realise “cookie” was the key, not “ApiSession”. I’m still annoyed by that.
After all of your coding you’ll need to setup your Intent Schema and Utterances. The Utterances are important. Try to think of as many ways you’ll say the command you’ll want and put them all down. Make it as easy as possible for Alexa to understand you!
Anyway after it’s all done you’ve got yourself a pretty cool setup for turning on/off lights, setting your home mode, or really anything. Speaking to your house to get it to do things is cool. I’ve put everything I’ve done here up on Github. Take what I’ve done and expand on it, improve it, and make it better!