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

Yes, but is they are having a hard time actually getting buttons to work at all, I don’t think they need to start trying to write custom commands into Harmony to flip a virtual switch 10 seconds after every command.
An " off button" is much simpler

Rooms-> Virtual Devices-> TV,Satellite (momentary capability).I tried button also.
Things-> TV,Satellite,Lamp,Motion Sensor,HarmonyPorche Light.
SmartApps->Amazon Echo,Logitech Harmony(Connect),Logitech Harmony Hub Control,Notify Me,Smart Lightning

I would like to pick (Watch TV) activity with the harmony triggers.
Edit Start Sequence
TV,STB,Samsung TV,Satellite

Edit End Sequence-All Off
TV,STB,Samsung TV,Satellite

Customize Remote


Sensor Trigger(1). This was configured earlier and works before I integrated Alexa

Starting Channel -Works


Actually it’s just having harmony turn on the TV when the virtual switch is on then exit the activity when the switch turns off. I just have to do it using smartthings harmony app and not ifttt, (virtual switch turns on/off to fast for ifttt).

Much more natural saying “Alexa, turn the TV on” or “Alexa, turn the TV off” then using two separate switches.

I agree they have to get the connection working first.

OK, on rereading I understand you going to use the "Logitech Harmony trigger " smart app.

Also forget anything else you’ve done in the past, we’re just going to follow the general instructions from post one of this thread. So the device type for the virtual switch that you’re going to use for this will be “momentary button tile”

Not button, not momentary, not anything else. The specific type is “momentary button tile.”

Pick one virtual switch, give it that device type, and tell us what you named it.

I am going to use Logitech Harmony Trigger" Smartapp. I had used motion sensor earlier to turn my TV on and start the news channel.Afer I integrated Alexa i turned the motion downwards so no motion is detected.

TV,Satellite changed to Momentary Button Tile

I choose TV,

Name-Samsung TV
Label- TV
Zigbee Id-
Device Name-SAM01
Type-Momentary Button Tile
Group virtual devices

Might also take a look at the harmony triggers FAQ and see if it helps at all. It doesn’t say anything about Alexa but it does tell you how to set up a switch and SmartThings is to control a activity in harmony. So then the only thing left is connecting echo to that switch.

Anyway, I just got a call and I’m going to be off-line for a few days but hopefully other people will be able to continue helping you with this.

BTW, i’m dependent on text-to-speech software so I’m having a really hard time following the information that’s in your posts. I’m sure it’s good information, it’s just not in a format that I can use.

But if I understand what you just said, you used to use a motion sensor to trigger the activity to go on and off. The old way of doing it was to add those motion sensors through the harmony mobile app right into the activity you were trying to control.

But what we do with Alexa control is completely different. we’re going to set it all up from the smartthings side, using the SmartThings mobile app. We will not be putting the virtual switches into the harmony activities for the most part.

So it sounds like maybe you just tried to replace the motion sensor names in the harmony activities with the virtual switch names and if that’s what you tried, that’s not going to work at all.

Instead, read the harmony trigger FAQ and you’ll see how you have to set things up from the smartthings side to be able to have the virtual switch trigger the harmony activity.

Then, again from the smartthings side, you’re going to authorize echo to turn on that switch.

I apologize if I’m way off base here, but just in case, that may be where the confusion is. The old method used to add the sensor names into harmony mobile app. But the new method uses “harmony logitech trigger smart app” and adds the virtual switch names in through the smart things mobile app instead.

Again, other people here should be able to help while I’m gone. Good luck!

I apologize the information was not in your format.But I appreciate all the efforts you are trying to resolve my issue.I am going off for tonight the better half has taken over the TV :grinning:

I will check the information you sent.Please keep the thread going

Again Thanks…

I re-installed Smartapps -Harmony Home Control and Harmony Triggers.Authorizing ST to Harmony worked fine.Harmony to ST I get a message Sorry we are not able to retrieve devices from your Smartthings account.

What does this indicate? Any ideas

I tried the simulated switch to turn off and on and it just didn’t work. It would turn on, but turning it off would do weird things. Now I just use momentary button tiles. It works.

Yes given that the phrase “turn off” seems to work fine to activate a momentary button, I agree its the simplest and best approach.

Eureka! I think I finally got it work.Thanks to @JDRoberts and everybody else in this thread.


I am trying to add a logic switch for the TV, but every time I try to add it to the start sequence of an activity in the harmony app so I can change its state to 1 I get an error message “Failed to retrieve state of TV Power”.

Nevermind. I got it. I just had to refresh the smartthings devices through the harmony app.


@johnosstyn, can you explain exactly what you did? I attempted to do the same but can’t get it to work. This is what I tried to do to keep everything in sync…

  1. Created a virtual switch and used the echo and logitech harmony control app instead of IFTTT.
  2. Used the Harmony app to engage the virtual switch at the end of my “Watch TV activity” start sequence.
  3. Used the Harmony app to disengage the virtual switch at the end of my “Watch TV activity” end sequence.

I figured this would keep everything in sync, regardless if I used echo or the remote.

For example, if I asked Echo to turn on the TV it would initiate the virtual switch and turn everything on. The virtual switch would be on and I could then turn the TV off with the remote or Echo.

If I turned the TV on with the remote, the harmony activity would turn the virtual switch on as well. This way I can turn the TV off with the remote or Echo. However, this set up didn’t work. As soon as I turned on the TV my TV turned on and off in an endless loop.

I really like the idea of having just the single virtual switch to turn a harmony activity on and off. Would appreciate some ideas. Thanks!

I created a momentary button tile switch. When Alexa is told to turn on OR off of this type of switch, the switch toggles on then off again.

So in smartthings harmony app tell it when the switch turns on, run the turn on tv activity, when the switch turns off exit the activity . This way the Harmony remote is never sitting in an activity so everything stays in sync. problem is when Harmony exits an activity it wants to turn the device off. to prevent turning off the tv go into the harmony app and

  1. harmony setup
  2. add/edit devices & activites
  3. devices
  4. pick your device
  5. power settings choose ----> (keep device always on but switch off when off button pressed)
  6. press the arrow on the right at the top of the screen
  7. choose (using two different buttons)
  8. press the arrow on the right at the top of the screen
  9. power on (choose your power toggle button), go back and set your power off button to something that does nothing (i choose up arrow)

when the above is all setup

you say “Alexa, turn the tv on” the momentary button turns on, harmony starts the power on activity (sends power command to your tv) a few seconds later the momentary button shuts off causing harmony to exit the activity (it wont turn the tv off because it sends the up arrow)

Now when you say “Alexa, turn the tv off” the same thing happens this time causing the tv to turn off.

Since harmony is never left in an activity, this all works no matter if the tv was Manually turned ON/OFF or was turned on/off with the original remote.

1 Like

Just make sure you don’t use a harmony activity to set channel as a start sequence aka if you say “Alexa, turn on Comedy Central” when TV is already on and tuned to CNN, it will turn off (on sequence being toggle) the TV, send channel number for Comedy Central to STB, and hit up arrow.

Likewise dont turn off the tv when it’s already off. That sounds self explanatory, but I currently do this via routine that fires when everyone leaves. I turn off all my lights, turn off the tv, and lock the door. If you fire this sequence when TV is already off the start sequence will turn it on ( toggle).

You are right Scott. I use this method to just allow me to turn my TV on/off with voice commands to alexa. My tv does not have descret codes so even changing inputs using harmony gets wacky after a while.

I also use this method to control a fan I have via harmony. Both the fan and tv are plugged into a power strip that I have toggle off then back on when I leave or use the good night routine in smartthings.

If I had descret codes, I’d probably still use this method, but would set up another device in harmony with the exact same model number and call that one “Alexa tv control” and leave the other device for more complicated activities.

I don’t think you can use your wake word in your device name, can you?

That is “Alexa, turn on Alexa switch” won’t parse correctly.

I think everybody’s going to find different phrasing natural. You just have to find the ones that work at your household.

For example, I say:

“Alexa, turn on cable” (or “Alexa, turn on Roku” Etc")

And “Alexa, turn off TV.” I don’t use “turn on TV.”

But it’s all a matter of what feels right to you. :sunglasses:

I use “Alexa, turn on tv” and “Alexa, turn off tv”. The other device I’d set up is in the harmony app itself. So if had a device named “alexa tv control” in harmony I’d use that for the method above and just tie the TV switch to run activities on that device, I’d could then set up another device in Harmony and run activities off that device where I didn’t want the momentary switch to exit the activity and throw a fake off command. Does that make sense?

Both devices would be the exact same model so harmony would send the same ir codes, I’d just have different ways to exit activities.

They way I described above is just to turn the TV on/off using one switch and everything stays in sync. Using it to turn on a cable box or roku, switching inputs probably won’t work. The method works for me because I rarely watch TV and don’t have cable and the need for different input, I just turn the TV on for background noise.

1 Like