Alexa + SmartThings + IFTTT + Harmony to turn TV on and off by voice (2015 version)

Thanks for the details! Although if have harmony exit the activity at the end of your sequence, does that mean you are no longer to use the harmony remote to change channels, volume, etc. If it’s out of the activity, it assumes everything is off.

This is how I setup everything up…

1.) Simulated Switch called Living Room TV (LRTV)
2.) Momentary button called Watch Living Room Cable (LR Cable)
3.) Watch TV Harmony activity —> turns on tv, receiver, cable box, and turns LRTV switch on.
4.) Harmony off command turns off everything.
5.) LR Cable button activates Watch TV activity.
6.) LRTV toggled on does nothing, LRTV toggled off activities harmony off command.
7.) Alexa “Watch Living Room Cable” activates LR Cable button
8.) Alexa “Turn off TV” toggles LRTV to off.

Everything is in sync using this method. It also correctly displays the status of the home theater being on or off. However, I really wish I could use the simulated switch to start cable and turn everything off. But using momentary tiles to start another activity (i.e. play xbox) when the is TV off just causes it too loop back to watching cable. I guess I could create a simulated switch for every activity, but then can’t use the general “Alexa Turn the TV off” command. This stuff gets complicated quick…lol.

I think I follow your set-up (wink.)

First, if memory serves me right – I think the “all off” functionality is “built-in” to Harmony. So, I don’t think you need to create your own activity for it? (e.g. look at your Harmony remote, and see the “OFF” button. That should indeed turn EVERYTHING “off.”) So, you don’t need to create your own/separate “off activity” within Harmony.

So, you just point your SmartThings off-switch to this Harmony button = easy peasy.
In your specific example, you would point your LRTV switch to the “Harmony off” button.

Second, I would name your virtual devices to be the same name you want to use for Alexa (minimize the number of translations along the way.) e.g. I would rename your switch from “LRTV” to be “Living Room TV.” This way, Alexa imports the exact name of the switch, and you can indeed just say “Alexa, turn off the Living Room TV” – and she will know exactly what you said.


Personally, I’d rename your “off” to be something more “global.” e.g. use the same/single command – to turn off the TV, the Xbox, whatever. This is why I named my off routine "Entertainment Center."
So, whether you are watching Xbox, or CableTV – you just say “Alexa, turn off the Entertainment Center” – and she will turn off WHATEVER is being used/watched.

Then, INCLUDE the “Entertainment Center” in ALL of your harmony enter/exit commands. Have it turn “on” the entertainment center when your “Watch activities” are run, and respectively have it turn OFF the Entertainment Center when you exit the activities. Remember: Harmony does it’s own “background math” to determine whether to really turn it off. If you are SWITCHING from one activity, to the next – Harmony compares the CURRENT state of the CURRENT activity, to the TARGET state of the NEXT activity. If both activities have the Entertainment Center “on” – then Harmony won’t turn it off, and back on. Instead, it will just leave it on as it makes the transition from CURRENT to NEXT.

Personally, I don’t need/use any “momentary switches,” because I want to see the current status of anything/everything, and turn devices on/off with specific intent. Momentary switches simply do a quickie on, and an automatic quickie-off, too. So, they never appear as “on” during subsequent status reviews. I prefer to only turn them off, when I REALLY want/see them as “off.”

e.g. when I turn on my TV/cable, I see ALL of the following switches/devices as "on:"
Entertainment Center, TV (set-top-box,) Soundbar, set-top-box.
Whereas, if we’re playing the Xbox, we’d see the following as "on:"
Entertainment Center, Xbox, Soundbar.
And, if we’re watching something from our PS media center, we see:
Entertainment Center, Computer, Soundbar.
If we’re streaming content from SmartTV Hulu:
Entertainment Center, Hulu, Soundbar.

So, if I’m away from home, and look at my SmartTiles dashboard, and I see:
Entertainment Center, Netflix, Soundbar
I know EXACTLY what’s on, and what it’s being used for. (e.g. my family/guests are watching something on Netflix.) Which means they are NOT playing Xbox, or watching satellite TV, etc.

It CAN initially be confusing!!! (agreed)
But, once you comprehend/understand it, it gets a little easier.

Extra credit brownie points:
Set-up other “modes” for your home, and then make sure all of your ST events are indeed running during the proper modes. More importantly, that they AREN’T running during specific modes.
Example: I created a MODE called “All OFF.” NONE of my ST events/activities/scripts are allowed to run during “All OFF” mode. This allows me (with just one button press) to disable EVERYTHING – and go old-school. So, when we have guests who aren’t comfortable with all of the automation and such, I can just “flip a switch” to turn EVERYTHING off. Once the leave, I can just switch the mode back to “home” – and everything resumes business-as-usual.
I have another mode called “Visitors.” This mode just disables SOME of the routines. (e.g. the living room lights that automatically come on every morning, and my Jarvis/IronMan script that speaks the weather/surf conditions and such.) I don’t want to rudely wake-up my visitors with lights in their eyes at 7am, when they are trying to sleep-in on my sofa-sleeper. But, all of the OTHER routines throughout the home still work BAU (business as usual.) So, “Visitor” is just a limp-mode of sorts. Whereas, “All OFF” is indeed a complete disabler of ALL our SmartThigngs stuff.
I also find the All-OFF to be helpful when I’m trying to create/test new routines. e.g. test ONLY that new routine. So, it’s the ONLY routine that’s active during the All-OFF mode. Once I work out the kinks, I then switch it to the other/respective modes, and remove it from the All-OFF mode.

Thanks Merlin! I think I might have described my setup poorly. I am indeed using the baked in all off function (off button) from harmony. I did not make a specific activity. The LRTV switch activates the harmony off button when switched to off. The on command does nothing, its activated at the end of every harmony activity to indicate the TV/Home Theater is on.

My Living Room TV is called LRTV within Smartthings, but in the echo app I placed it in a group called Living Room TV. There is also a group called Living Room Cable for my LR Cable momentary tile. Saying “Alexa turn on Living Room Cable” activates the momentary tile, which turns everything on and activates the LRTV switch to indicate the TV is on. I also have other activities setup the same way. For example, “Alexa turn on Living Room Roku” activates the LR Roku momentary tile, which starts the harmony roku activity and turns the LRTV switch on. At any point I can say “Alexa, turn off Living Room TV” to turn everything off, regardless of the activity I am in.

Does that make more sense?

I didn’t know Alexa could activate a device without putting it in a group. Never thought to try it and it saves a step!

While this method works, it does not indicate what activity someone is running. I just know that the home theater is on. I like how your setup indicates it is on and what activity they are using. In order to do that, you are using simulated switches for everything? So when you say “Alexa turn on TV” it starts your Harmony Watch TV activity, which toggles your Entertainment, TV and soundbar smartthings switchs on? Then when you say “Alexa turn Entertainment System off” it activates the harmony off button, and toggles all smartthings switches off…correct?

What happens if you switch an activity, say from TV to xbox. Does the harmony activity switch the cable smartthings switch to off automatically or do you need to add it to the end of every harmony activity?

Sorry for all the questions just making sure I am following you correctly.

It used to work that way before harmony added support for home automation. It does not work that way now.

how adding home control devices change the concept of "all off"

Now, there is one and only one “entertainment activity” active at a time, but the “home control devices” can remain active while the entertainment activities are going on and off.

You cannot map anything to the off button anymore. Not in the native harmony app, not through SmartThings.

Instead, pressing the off button on the physical remote does only one thing. It turns off the current active entertainment activity.

So if, say, you have Phillips hue lights connected directly to your harmony, pressing the off button on the physical remote will not turn automatically off those lights. It will turn off the current entertainment activity. (You can see why people would’ve wanted this distinction.)

You are also allowed to include home control devices in any home entertainment activity, which is how you set up scenes so that when you turn the TV off, the mood lights also go off. But maybe the overhead lights come on.

So there is no “all off” concept anymore.

what happens when you switch from one entertainment activity to another in this new design

Because only one entertainment activity is active at a time, when you choose a second entertainment activity, the first entertainment activity is automatically ended. However, harmony will not turn off any entertainment devices from the first activity which are needed in the second activity. That’s how you can switch from using your Roku as an input to using your cable box as an input without having your TV go off and then on again.

What the off button does now

This should mean that only entertainment devices that are needed for the current activity are on during the activity. Therefore, sending an “end activity” command for the current entertainment activity should turn off all entertainment devices that are currently on, Plus turn off any specific home control devices that you included in that entertainment activity. And that’s exactly what pressing the on off button on the physical remote does now. It just ends the current entertainment activity. No matter what that activity is.

Again, this is all a change from how it used to work, but it is how it works now that harmony controls both entertainment and home control devices.

Turning off from SmartThings

So the easiest way to simulate pressing the off button from SmartThings is to create an entertainment activity that does nothing but turn on/off whatever your master power device is. In my set up that is my television. For some people that’s their soundbar. For other people it’s a different device. But whatever device you have where turning that one off turns off your entertainment set up.

Once you have that activity on the Harmony side, just send “end activity” for it from SmartThings. Harmony will switch to that activity and turn it off, thus turning off all your other entertainment devices that are associated to it.

Or you can turn off any activity that includes the master device and get the same result. :sunglasses:

It sounds like the setup you describe is doing the same thing (by the way, you ought to start your own project thread for that since it is quite different from the project described here, and people are always interested in seeing different ways of solving the same problem), it’s just doing it for a different reason than what you described.

For more information, see the Harmony website.

Hi everyone…I will be setting up my Smartthings + Harmony + Alexa devices this weekend. The primary purpose is to control TV activities (on, off, change channels) by voice. Is the first post of this thread still the best way to set this up?

The first post still works, but now that the two-way harmony integration is out of beta, most people, including me, are using that smartapp instead of the IFTTT step.

So everything is the same except instead of setting up IFTTT recipes, you set up “harmony triggers” using the following FAQ:

That way everything just runs a little faster. But the whole virtual switch concept is still the same. :sunglasses:

But there are a lot of different ways to do it. It really just depends on how your household uses your home entertainment center. At my place we have a lot of different people, some using echo, some using the button remote, sometimes during the same viewing session. So synchronization is a big issue for us.

If you live by yourself and you’re only using echo, you don’t have to be as fussy about the switches.

Thanks! will give it a shot this weekend.

1 Like

Okay, just messed with the settings a bit and adjusted a few things. This is what I have, hopefully it’s nice and clear…

LR TV OFF (Logitech Harmony Trigger) - Switch Turned Off --> Harmony Activity Off. There is no switched on function for this trigger.
LR Watch Cable (Logitech Harmony Trigger) - Switch Turned On --> Watch Living Room TV Harmony Activity. There is no switch turned off for this trigger.
LR TV Switch - Includes the following SmartApps; Logitech Harmony (Connect), LR TV OFF (Logitech Harmony Trigger), Amazon Echo
LR Watch Cable Switch - Includes the following SmartApps; Logitech Harmony (Connect), LR Watch Cable (Logitech Harmony Trigger), Amazon Echo

Living Room Watch TV Activity
Start Sequence - TV ON, Denon Receiver ON, TV HDMI 1, Denon Receiver TV/DBS, LR Watch TV ON (ST Switch), LR TV on (ST Switch)
End Sequence - TV OFF, Denon Receiver OFF, LR Watch TV OFF (ST Switch)

Living Room TV Group - LR TV Switch
Living Room Cable Group - LR Cable Switch

Is this what you basically have, minus the TV Off function called Entertainment Center on your end. I think I set it up correctly. It did go into an endless power on/off loop for a bit, had to reboot the harmony plug to get it to stop. Not sure what caused it.

Hello New Here.

Finally after reading this post, I have setup my Alexa Echo + Smart Things + Harmony Hub to work together.

Currently - My setup is running this way.

Alexa trigger Kodi - Starts Kodi Activity
Alexa trigger Cable - Starts Cable TV Activity.
Alexa trigger Xbox One - Starts XBox One Activity.
Alexa trigger Shut Down - Shuts down all my equiments(tv, receiver, and etc)
It was very easy to setup and works great.

for above items all i had to do was add certain activity for the That portion. it was so easy to setup for a newbie like me.

However is there a way to create volume up/down or starting certain channels as activity so it can be easily hooked to that portion?

Thanks in advance. Have a nice weekend.

I set my TV and BluRay up as well with the Alexa triggers and learned a couple of things that were not initially clear.

First, don’t use someone else recipe, create your own and let it prompt you through the steps. I never could get an existing recipe to work.

Also didn’t understand about adding the action to Alexa’s To Do list and missed that step. Once that was done, everything worked great.

Still don’t fully understand the connection between the Trigger command and the To Do list, but it’s working.

UPDATE - deleted the To Do list items and everything still works.

1 Like

You shouldn’t need to to do list at all. That’s an older method that was replaced by the triggers.

Sure, the key is to always first create the activity through the Harmony app and make sure it is working over on the Harmony side.

Once you have it working there, it just becomes the “that” to your Alexa trigger.

One of the things that you will run into, though, is that Harmony doesn’t let you do the same activity two times in a row. So if you want to toggle volume up three or four times, you actually have to have two different volume up activities and switch back-and-forth between them.

Also, in order to get control of the other buttons back, you have to either then trigger a device activity after you change the volume, or you have to set up the change volume activities so there’s one for every one of your input channels. Either way is clunky.

I use them because I’m quadriparetic and I really need totally hands-free control of the volume. But I think most able-bodied people will find it more natural to do Channel app or volume up using the buttons on the Harmony remote.

So for a general volume up activity, create an activity that does not change the HDMI channel and it puts volume up as a step. That’s pretty much all you need to do. But you need two of those with different names.

So I may say “Alexa, trigger lion” (my first volume up)
“Alexa, trigger tiger” (.my second volume up)
“Alexa, trigger lion”
“Alexa, trigger DVD” (map buttons back to the WATCH DVD activity)

That’s a lot of work just to take the volume up three notches, but it’s what I do. :sunglasses: It’s still easier for me than physically pressing the buttons.

Sample Harmony activity to turn TV volume up one.

Here the TV is listed three times in the “Louder 1” Activity Start Sequence. Once to power on, once to NOT change the input, and once for the volume up key

Here I am setting the device to NOT change the input channel.

And selecting the VolumeUp key as a step in the start sequence. Choose Edit Entertainment Device, then the device, then the command. (This is also how you could choose a starting channel)


The end sequence just powers off the master device. This means it will not turn off if I’m changing to any other activity that also uses the TV.

add a second activity that does the same thing so you can switch between them

Then I make a second activity that does exactly the same thing, it just has a different name.

Again, make sure you have the activity working the way you want on the Harmony side from both the Harmony app and the button remote before you add the echo trigger in IFTTT. :sunglasses:

And as I said, I think control of volume is way too much work for most able-bodied people, both to set up and to use every day . But for those with limited hand control, it’s very useful.

Adding a specific channel to the start sequence

Setting up a starting channel is work to set up, but very easy to use. It just becomes “Alexa, trigger Disney channel” or “Alexa, trigger ESPN TV” or “Alexa, trigger Netflix” or whatever. :sunglasses: So I think a lot of people like those. It’s just a matter of setting a starting channel for the activity. But you will have one activity for every favorite channel. And one IFTTT recipe for every activity. So that’s why you have so much set up work.

Wow thanks for all the info JD Roberts.

I didn’t see ur replies until now. I got it setup similar way now with trial and error.

First thing I setup was mute activity. I quickly found out that I can’t use the same activity to unmute. So I created 2 separate ones then I found out non of my buttons were working. I always had my tv and receiver to be always on so switching activity wasn’t a problem. As for the buttons I just added them to the mute activities like u suggested.

Then I did same for pause and play.

I use my system with kodi and it worKS well.

If I want to control everything by voice this is going to take lots of activities per real activity.

I wish ifttt and logitech would let us create sub activity like specific device button action without involving power and inputs.

For example. Press mute button on receiver. Press P on mce keyboard. And hook this sub activity or button action to “THAT” portion of the receipe.

This way the mute trigger can be shared by multiple activities.

Regardless this is extremely cool controlling my ht system via voice. Thanks for the detailed explanation with screeshots. I am going to reread everything to see if I missed anything. Thank again JD Roberts.

1 Like

As for cable TV channel thing. I gotta try that out once I move. I just bought a house and will be moving in 10 days. Will not have cable until then. Gonna try to automate lots of stuff including security and thermostat.

I know many of us have been migrating away from the IFTTT step/stuff, to focus on “native” solutions that can be run purely within our homes.

But, the new Echo+IFTTT functionality for defining your own commands, DOES add-in a conversational option now.
e.g. instead of saying “Alexa turn on…” or, “Alexa turn off” – we can now also say, “Alexa, trigger…”

When we leave the house, we now say, "Alexa, trigger goodbye."
Or, when we’re getting ready to go to bed at night, we’ll say, “Alexa, trigger goodnight.”

Granted, I already have the “goodbye” actions covered via presence sensors, anyway… But, sometimes you just wanna SEE everything turn off (real-time,) – instead of knowing/assuming it will automatically turn off moments later in your wake.

We just find this “trigger” word to be slightly more “conversational” for some actions.
Sure, I wish we didn’t need to say “trigger.” I wish we could just say, “Alexa, goodbye/goodnight” – and tie an IFTTT or SmartThings event directly to those commands. But, “trigger” seems more conversational than “on/off” for these situations. (e.g. Otherwise, we’d have to say something like “Alexa, turn on/off goodbye.”

Wishes for Alexa:
1.) Ability to configure SPEECH commands via IFTTT as “actions.” e.g. IF presence sensor active, THEN speak "Welcome home, Sir."
2.) Ability to send commands/instructions to Alexa via IP/network, instead of voice-only. e.g. Have SmartThings or home PC send her a “sentence” – so she can respond. e.g. SmartThings sends a “Play Pandora” command to Alexa when presence sensor arrives (behind-the-scenes communication TO Alexa.)

Net result: We arrive home, SmartThings senses the presence sensor on our key fob, and triggers Alexa to say, “Welcome home, Sir.” After which, SmartThings sends another command to start Pandora (behind the scenes) and the only thing we here is Alexa saying, “resuming your U2 station on Pandora.” – followed by music, of course.

I think ANY sentence that we can speak to Alexa, she should be able to consume via IP/network (then speak the results, etc.) This should include volume-level commands (so we can script volume level changes based on the time-of-day, or SmartThings events/triggers.)

Just my two cents…

For mute wouldn’t it be easier to create a simulated switch called “Mute” and have that run an activity that simply mutes or unmutes based on whether it’s turned on or off? The main issue I see with this is keeping it in sync since muting from Harmony wouldn’t flip the ST switch. I have the same sync issue with turning everything off - I almost always use my voice to turn stuff on but if I turn everything off with the Harmony remote the “TV” switch is never turned off in ST.

How can I trigger to shut off everything
My problem is I have to shut down the tv the cable box or mygica android box and my A/V reciver how can I get them to all off trigger?

Sorry I did scroll through this thread and perhaps missed it.
I only found how to trigger off the “main” device
But I need them all off.

Many people have their home entertainment equipment set up so that turning off one main device will automatically turn off the others. But if you don’t have that set up it’s fine.

First create an activity in Harmony to shut all devices off

Remember the first thing is always to get a Harmony activity set up that does what you want. Once you have that harmony activity working when you select it from the Harmony handheld remote, or from the Harmony app, then you can add the IFTTT recipe to have a Alexa trigger it. But first get it working perfectly on the Harmony side.

So in this case, you probably just need a Harmony activity (which you can call whatever you want to) that does nothing except include each of the devices that you want to have turn off. So maybe it’s the TV and The game box and the Roku or whatever.

The only thing that activity does is turn on those devices when it starts, and turn off those devices when it ends.

I have one like this that I call “shut down.”

Harmony likes to turn everything on before it turns them off

Once this is set up, when you select it to start from Harmony, it will first turn on any of those devices that are not already on. Then when you select it to turn off from Harmony, it will first turn on any of those devices that are not already on, and then immediately turn all of them off. Which is a little weird but gets the job done.

So again, still all just looking at the Harmony site, if you have an activity called shutdown that includes your television and your Roku and your game box, when you start shutdown, those three devices will come on.

When you end shutdown, those three devices will turn off if they were already on.

If you hit the end shutdown selection when only the TV was on, it will first turn on the Roku and the Gamebox and then it will immediately turn off all three devices, the TV, the Roku, and the game box.

So now you have a shutdown activity in harmony that you can trigger from Alexa or from SmartThings.

Create a recipe to END the shutdown activity with an Alexa trigger

Now it’s easy. Use IFTTT to create a new recipe. Choose an Alexa trigger for the “if” . I just use “shutdown.”

Use the Harmony channel for “that,” select your shutdown activity, and make sure you select end the activity. That’s all you need.

Now when you say “Alexa, trigger shutdown” no matter what your entertainment devices were doing, harmony will turn on the devices in the shutdown activity, and then immediately turn them off.

Thanks @JDRoberts I will give it a go. :smile:

1 Like