Turn TV/Lights on if sim switch is already on


1) Give a description of the problem
OMG Am I asking MORE questions??? :blush: Why yes, yes I am! And I greatly appreciate the help!

So, I have a ST Simulated switch called “TV Time”. When I say “Hey Google, turn on TV Time” I have a piston that, as you see below, when the TV time switch is turned on, three lights turn on, and the “Watch TV” Harmony command starts (That turns on my TV and Receiver, sets them to the correct input, etc etc).

When we’re done, we say “Hey Google, turn off TV Time” and I have another piston that turns off the three lights and the “Watch TV Harmony” command.

My problem is if my SO (or me, we’re so used to this!) use our universal remote to turn the TV off and then leave the room, using the wall switches to turn the lights off. If we do that, the next time we go into the Living Room and say “Ok Google, Turn on TV Time”, that sim switch WAS NEVER TURNED OFF with the “… turn off TV TIME” command… So nothing happens.

We have to tell Google (or use the App) to turn that sim switch OFF, THEN we can turn everything on with the … turn on TV Time command (or use the remote and wall switches to turn stuff on. Bleh).

2) What is the expected behaviour?
The TV ON or OFF commands working, regardless if we make a mistake and use the remote and wall switches!

3) What is happening/not happening?
as above

**4) Post a Green Snapshot of the piston!


This is a common occurrence with Simulated Switches. The easy way is to make a “Reset” piston that flips the SimSwitch off every day at 4AM. Another option is making a piston where every time the wall switch turns off, if the time is between X & Y, then turn off SimSwitch.

Perhaps my favorite method is using your “Good Night” piston to reset that SimSwitch.


You know, that may not be a bad reset for a lot of things I have…

I have to think about this more - because there are multiple times a day that we’d go in and watch TV, and then leave the room, then come back later to watch TV.


At the risk of stating the obvious, don’t forget to add this to your equation:
If a SimSwitch has a trigger for both on and off (or open/close) then keep in mind that the “Reset” piston may execute a handful of pistons back to back…


Oy. Yeah, that’s an excellent point. Back to the thinking board. Drawing hat?


Yep, I’m dredging up this old topic. I’ve moved - but still using the piston. Only one light in this Living room to command. And still running into the same problem as I’m trying to think of a solution other than the “goodnight” piston reset.
Here’s some thoughts and questions:
I have separate pistons for the turn on and turn off - is that necessary or can I fold them both into one?
What if I did another piston (or maybe included it?) that said IF the LIGHT AND the “WATCH TV” are ON, then turn TV TIME switch ON. IF the LIGHT AND the “WATCH TV” are OFF then turn TV TIME switch OFF.


I believe that the “Watch TV Harmony” command is sent, but the current status is not stored or able to be referenced by webCoRE.

The main way to achieve this:

IF SimSwitchA changes to on
    Turn on a bunch of things
    Turn OFF SimSwitchA

This is just a small tweak to your current piston… This effectively resets the SimSwitch moments after it turns on, so it is always ready for the next ON command…
(but by itself, this does not resolve the out-of-sync OFF commands)

If the family is in the habit of getting the devices out of sync, then creating a second SimSwitch (that does the opposite) solves this portion:

IF SimSwitchB changes to off
    Turn off a bunch of things
    Turn ON SimSwitchB

This effectively resets the SimSwitch moments after it turns off, so it is always ready for the next OFF command…

The fun part is getting a normal voice prompt to intuitively control both devices.

With Alexa, I can make “Routines” (or I like to call them Aliases)… I believe Google has a similar method.

Basically, I tell Alexa, when I say, “Alexa, Turn on TV”, she turns on both SimSwitchA and SimSwitchB. (“A” works, but “B” is ignored by webCoRE). When I say, “Alexa, Turn off TV”, she turns off both SimSwitchA and SimSwitchB. (“A” is ignored, but “B” works)

This essentially makes a single voice command synchronize both SimSwitches… and the same voice prompt can resync in the other direction.

(since webCoRE is smart enough to know that one of the switches did not change… so no incorrect code is executed)

Pro Tip:

If you go this route, I would keep SimSwitchA trigger and “turn on” code in one piston, and SimSwitchB trigger and “turn off” code in another piston.


I kind of like this - and yes, Google DOES do similar.

I just purchased a remote that doesn’t send commands to the TV or cable box - it sends commands to the Harmony Hub. Maybe that’ll alter things… :slight_smile: We’ll see!


The smarthome solver guy on youtube has an interesting automation: He monitors the TV state using a smartplug, then turns the lights on if the usage is high, and off when the usage is low. If you had a spare $25 lying around, you could create a piston that watches for “Watts to be less than 5”, then switch off your sim switch.

Also, I like your idea; I should pick up one of those harmony hubs. I’d probably change the brightness of the bulbs, instead of turning them on, as motion sensors in that room already turn the lights on.


So I got the remote that pairs with the Harmony Hub. Turns out that Harmony DOES update the state of “Watch TV” (turns on the TV and cable box, sets hdmi input, etc) to Smartthings. So - it’s all working perfectly. And yeah, I could set the brightness, but we tend to just leave them at 60%.


Does it detect a ‘paused’ state of whatever you are watching? I’ve always wanted that feature:

If “paused”, set lights to 60%
If “Unpaused”, set lights to 20%


Ha! That’s a neat idea - I’ll have to try it and see!