Updated 12 November 2015 after Amazon added “Triggers” to their IFTTT Channel for Alexa
As valuable as I personally found this project, and as much as I learned in doing it, as of 12 November 2015 it’s now no longer necessary.
Amazon has added verbal triggers to their IFTTT channel. So you can say anything you want to as a trigger to Alexa and use that as the “if” for an IFTTT recipe, and have that trigger anything that has an IFTTT “that” channel. So SmartThings, Philips Hue, Harmony activities, etc. No virtual switches needed, no synch issues.
It really is that easy.
If you’re new to IFTTT, here’s a good overview:
You may still want to use the direct Harmony/SmartThings integration to control certain aspects of TV watching, like limiting your kids to 30 minutes of Netflix on Tuesday’s when they’re the only ones home or whatever, but for that, you would use SmartThing’s Harmony smartapps, not the IFTTT channel.
I’m going to leave this project report up, because it’s still a good model for working with other IFTTT channels, but for basic Alexa/Harmony I would now suggest just starting from the Alexa side and using their triggers.
Which IFTTT recipes will you need?
As far as Which recipes you will need for the Alexa trigger method, that’s pretty straightforward.
You will need one recipe to start each of your regular harmony activities like “watch cable” or “Watch DVD.”
Plus you will need one more recipe to end an activity to turn off the power to your master a/v device. This can be any activity that includes that main power device, or you can set up a new Harmony activity that only includes the main power device. In my set up, my TV is my main device. When it goes off, my DVD and Roku also go off. (My cable settop box is an always on device.) other people may have their sound bar as their main device or a theater controller. Just create a recipe that ends the activity that turns off your main power device. I have Alexa call that “shutdown.”
If you have any other Harmony activities you want to control through echo, just create one recipe for each one to start it.
The only exception is for harmony activities that you might want to do more than once in a row. For example, because I want totally hands-free control of my harmony, I want to be able to turn the volume up and turn the volume down through Alexa. I can create a harmony activity that just does volume up, but I can’t do it twice in a row. So I have to have two volume up activities and two volume down activities so I can switch between them. This is pretty clunky, so most able-bodied people will probably just use the button remote for volume, but it’s useful for people like me who really need hands-free controls.
==============================================
USING ALEXA TO CHANGE HARMONY ACTIVITIES VIA SMARTTHINGS AND IFTTT (old 2015 method)
The following method is based on the original echo/Smartthings integration. That was updated for 2016, and the new method creates its own virtual switches, so most people will want to use the new method instead. I will post a link to that thread in a minute.
I am going to leave the rest of this thread here because there’s a lot of very valuable information on how harmony activities work and how to set them up which will still apply even with the new SmartThings integration.
But at this point, you can really just skip the entire rest of this post and either go immediately to the thread on the 2016 method, or read through some of the reply posts to this one if you want ideas on setting up harmony activities.
=======================================
THE ORIGINAL 2015 METHOD
This method gives you natural language voice control to turn the television on and off and switch between harmony activities. The main method does not give you control of the volume or fast forward. But it’s very nice to have. (I’m quadriparetic, so I use voice controls as much as I can.)
It’s very simple as long as you use momentary switches. I use the “momentary button tile” device type in the IDE. As others pointed out in the Echo topic, the use of momentary switches means you don’t have to worry about keeping your voice commands synchronized with the physical button universal remote. You can switch between them as much as you like.
You just need one momentary switch for each Harmony activity you want to turn on and one extra momentary switch to power off everything.
1. CREATE ONE MOMENTARY SWITCH FOR EACH ACTIVITY, PLUS ONE MORE TO POWER OFF
I created a Room called “Entertainment Center” with four virtual switches: TV, cable, Roku, and a DVD player.
I will have four harmony activities: Watch cable, watch Roku, watch DVD, and power off (which turns off the TV and the other devices are slaves to it).
So I added four momentary button tiles in SmartThings: Cable virtual, Roku virtual, DVD virtual, and TV (which turns off the power).
If you have never created a virtual device in smartthings before, here’s the FAQ for that. It’s easy. Just choose “Momentary button tile” as the new device type if you want to use the same one I did.
2. AUTHORIZE ALL THOSE NEW BUTTONS FOR USE BY IFTTT AND ECHO
I authorized them for use in echo and IFTTT. I didn’t need to authorize them for harmony because I’m not turning them on and off from the universal remote.
I started with authorizing them for IFTTT. Choose the Rooms view, then SmartApps. You will see an IFTTT smartapp.
Open it, and you will see the list of devices you have already authorized for IFTTT use.
Tap on the green plus sign to open the list of all SmartThings devices. You can add or remove them here.
When you are finished, tap Done at the top right of the screen. This will return you to the list of authorized devices.
Tap Done at the top of that screen.
Now you are going to repeat the authorization process, but this time authorizing the switches for use by Echo.
Again, start with Rooms view and select Smartapps. This time choose the Echo app.
You will see the list of devices you have previously authorized for use by Echo. Tap the green + to open the full list of SmartThings devices at this location…
When you have finished marking all the devices that you want echo to be able to control, tap Next at the top right of the screen.
Now discover them in echo, then tap Done to complete this step.
3. SET UP YOUR HARMONY ACTIVITIES IF THEY DON’T ALREADY EXIST
Because we are going to use momentary buttons for our virtual switches, we will not be able to turn off the virtual switches by voice. We can only turn them on. So we are going to create one extra harmony activity that will be only used to turn everything off.
In my case, I already have the Roku and the DVD player slaved to the TV. So I just need an activity to turn off the TV, and all the other activities will be turned off, and all the devices will be turned off except the cable settop box, which is what I want.
(It turns out that if your television has to be turned off with what harmony calls a “manual” command, rather than a code, then it is possible for things to get out of sync if someone presses the physical button on the television to turn the power on or off. This is a known harmony issue. If you have one of these type of televisions, and run into this problem, see the discussion in the posts below this FAQ for various approaches to the situation. But as long as your television turns off with a code, the momentary button takes care of any synchronization issues. )
So here are my four Harmony activities:
And here you can see that ending the power activity does nothing except turn off the TV. This is the one I am going to control with the “TV” virtual switch.
4. NOW SET UP ONE IFTTT RECIPE PER BUTTON
Since these are momentary switches, you don’t have to worry about setting up separately for an on and off state. When you give the voice command, the button will act as though it was briefly pressed on and then turned off again. This is why it can’t get out of sync.
I set up four IFTTT recipes:
- if SmartThings “cable virtual switch” turns on, start harmony “watch cable” activity.
- if ST “DVD virtual switch” turns on, start harmony “watch DVD” activity.
- if ST “Roku virtual switch” turns on, start harmony “watch Roku” activity.
- if ST “TV virtual switch” turns on, end harmony “power” activity.
So you are going to start all the device activities, but end the one extra power activity.
5. FINE-TUNE THE VOICE COMMANDS BY USING ECHO GROUPS.
You can put the switches into individual groups of one through the echo app if you want the name that you say to be different than the name that shows up in your smartthings mobile app.
I like to see the word “virtual” on the switch in the mobile app, but I don’t want to have to say it. So for example I put the switch which is named “cable virtual” in SmartThings into an echo group by itself that’s just called “cable.” Also, if one person always says “TV” and another person always says “television” you can just have two different Echo groups that each have the same one virtual switch in them. I put the “TV” switch into a group called “Exit Routine.”
My Alexa voice commands are:
“Alexa, turn on Cable.”
“Alexa, turn on DVD.”
“Alexa, turn on Roku.”
“Alexa, turn on Exit Routine.”
The first three can be used to either start the TV and that activity, or switch from one activity to another when the TV is already on.
The last one, Exit Routine, can be used no matter which activity is currently running. Note that I’m saying “turn on Exit Routine” even though that Harmony activity is going to end. “Turn on” in this context means “press the button.”
And because Echo is a natural language parser it will figure out variations of each of these voice commands. I could also say “Alexa, turn the DVD on” or “Alexa, switch on the DVD” and echo would figure it out.
So that’s just one example of how to use the new echo/SmartThings integration.
Before this, I was using Siri to send a voice text to IFTTT. It worked much the same way, but the voice commands were much more awkward and you had to say them exactly the same way each time.
So I used to say, “Hey, Siri, tell House hashtag Roku underscore on.”
Now I can just say, “Alexa, turn on the Roku.”
It may not seem like a big difference, but if you use voice a lot it’s way easier.
6. SOME VARIATIONS
There are a lot of variations you can do with this. I’m not going to write out all the instructions for each, but I will summarize some of the ones that community members have shared and if you have questions about them, ask them below. Please reference the section number so we know which one you’re asking about.
6A. Adding Favorite Channels, like “Turn on ESPN TV” or “Turn on the Disney Channel.”
@Mbhforum points out that since Harmony lets you start an activity with a particular channel, you can set up an activity for that specific channel, give it its own virtual momentary switch, and you will have an Echo voice command to go straight to that channel. Nice!
One caution: anytime you are making Harmony changes, only do a few at a time and then save. Harmony does some kind of internal refresh that can lose changes if you do a whole bunch at once.
@Mbhforum reports also that he had more success putting the starting channel in as part of the starting sequence, not using the start channel field. See his posts below. Apparently there is a harmony bug if you have multiple activities with a different starting channel for the same device. But if you set the starting channel in the “start sequence” for each activity, it works OK.
6B. Adding a regular switch to allow for the voice command “Turn TV Off.”
My least favorite part of my own method is that you have to say “turn exit routine on” to turn off all the power. Another community member, @zj4x4 , offered a modification. If you make the extra switch a regular binary on/off switch instead of a momentary toggle, and you add turning on that switch to every other harmony activity, you can then use turning off the exit switch to turn off the power instead of having to turn it on.
So in his method, you get to say “turn TV off” which is obviously much more natural language.
I really like his method, and I am going to use it myself, but it is somewhat more complicated because now the extra switch is handled completely differently than the individual activity switches. Here’s his explanation:
This variation requires the following changes:
Make the virtual power switch a Simulated Switch in the IDE instead of a momentary button tile.
Authorize Harmony to access that switch. (You only need to authorize Harmony for the one power off switch, not the momentary switches.)
Now for every Harmony activity you have except the Power Off activity, add turning on the virtual power switch to the start sequence. That way you’ll be able to use the power off voice command.
Finally, change the IFTTT recipe so if the virtual power switch is turned off, Harmony will end the power off activity.
You also have to remember every time you add a harmony activity in the future to add turning on the exit virtual switch to its start sequence or “turn TV off” won’t work by voice for that particular activity.
So like I said, I like this method, I’m going to use it myself, but it is certainly more complicated than using “turn on exit routine” with a momentary button because you have to make sure the binary switch gets turned on so you’ll be able to turn it off again later.
6C. Turn the TV on or off as part of a Routine or Mode Change
@MichaelS is working on a new smartapp called “Alexa Helper” to make it super easy to assign virtual switches for Echo to use to change modes or Routine. That way you could make turning off your TV part of your “Good Night” Routine.
For those interested in this approach, see his topic:
6D. Granular Control of Individual Remote Buttons like Pause and Rewind
Turns out there is a way to do this for some devices, but it’s a lot of work to set up and the voice commands are a lot clunkier than the ones we’ve been using so far. It’s useful to me as a quadriparetic, but I’m not sure ablebodied people would find it worth the effort. Anyway, discussion of this was added to the thread in Post 90 below on September 1, 2015.
A friend of mine who uses switch control mentioned that harmony activities can go down to the granular level (pause, play after Pause, Rewind, etc) but you have to put them in as a “step” in the activity. And the trick I hadn’t realized is that you have to also include whatever device controls the power for your home entertainment system. Otherwise switching to the granular activity will shut down the TV.
6e. Skipping IFTTT and using the Harmony Triggers smartapp instead.
At the time of this writing, the smartthings direct integration with harmony, using a smart app called “Harmony triggers” was still in beta, and not fully baked. Once it is working reliably for everyone, you’ll be able to leave out the IFTTT part of this process, and instead of setting up an IFTTT recipe to respond to each virtual switch, you’ll set up a trigger in the Harmony Triggers smart app. Otherwise everything else will be exactly the same.
If you don’t know how to find/use the Harmony Trigger smartapp, see the following FAQ: