Help with Piston to keep lights on while watching TV


#1

1) Give a description of the problem
Because the motion sensors turn inactive the lights go off while watching TV

2) What is the expected behavior?
I would like the lights to stay on and stay at the colour that we might have them at while we are watching TV and the motion sensors don’t detect motion.

3) What is happening/not happening?
While watching TV the lights go off when we don’t move enough and then come back on when we wave our hands.

**4) Post a Green Snapshot of the piston![image|45x37]

This is the piston that I have setup and I am wondering if I have this right. I have setup a Virtual Switch that I have setup another piston to turn on when the TV plug’s power is higher than 10 and turns off when the power is below 9. So when the TV is on the switch should go on and when we turn the TV off the switch should go off. Then I put it into my Lights piston so that if the switch is off the lights should work as normal. So my question is, if the switch is on and the piston does not continue, will the lights just stay on then? And if we change the light colours it should just stay that way until the TV power goes off, right?

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

I am slightly confused, if you have a Z-Wave power monitored ST switch connected on the TV’s power, you could just activate/deactivate the room lights when the TV switch’s power is above/below the conditions you set and the light will synchronize with the TV’s power usage. Changing the Z-Wave’s light’s attributes (eg. dim level, color, etc) should not affect the WebCore piston. Also, if one were to manually turn off the Z-Wave light, the WebCore piston should not activate since it is only monitoring the power usage of the TV to turn on/off the light.

You could also investigate the following:

  1. Try the WebCore “If {MotionDevice} changed in the last {X}” along with a second condition of {device} power >= {10}. This logic assumes that you or someone in the sensor’s range might move within that period of time when the TV is active and therefore reset the time from when last motion was detected by ST.
  2. Or purchase a Logitech Harmony Remote with Hub and integrate this device into ST and therefore know exactly when your media center (TV, Roku, Tivo, BluRay, etc) devices are active/inactive.

#3

I guess I could put it all in one piston but I think it would get a bit confusing because I want the lights to come on when we go downstairs at anytime, whether we are going to watch TV or not. And I want them to stay on while we are down stairs. However, when we are watching TV I don’t want the lights going off when we don’t move enough or I don’t want them changing to the default 100% white if we have changed them to Blue 30%. So basically, I need the motion piston to be disabled when we are watching TV and enabled when we are not. Also, when we have left the room, I want the lights to turn off in a few minutes. I don’t want them to be on for a half hour after we have left.


#4

I use an override virtual switch for this type of situation and then add that switch as a restriction.

In this piston, switch 64 is the override switch and 68 is the actual lamp.


#5

When does your Virtual Switch turn off?


#6

When I turn it off. :slight_smile: it’s a virtual switch. you can turn it on and off in the ST app or actiontiles…whatever you use to turn things on and off.


#7

I think this is similar to what I have. I have the virtual switch being triggered on and off in another piston that detects when the TV is on. Then I use that virtual switch in the above piston to hopefully keep the lights on.


#8

Okay…so, maybe I’m not understanding your problem then. What’s your question?


#9

I wanted to know if my thinking and piston would work. Just wanted to know if I was missing anything.


#10

This is not a DIRECT answer to your question but I had a very similar problem with a similar setup and I just want to share how I solved it.

Our problem was with bedroom lights. If you stop moving around while reading or watching something lights would turn OFF.
And no matter what I tried it somewhat failed. I even placed 2 motion sensors on the ceiling looking directly down to the bed but did not PROPERLY work.
I even tried a sensor that would pick up a vibration and placed it under the bed but still the same.

Finally @WCmore gave me a great idea and I started using Global Variables AND PHASES.

Each room has a PHASE
PHASE 1 - Motion detectors active
PHASE 2 - Lights ON, and no need for motion detectors
PHASE 3 - All lights OFF and motion detectors deactivated (Sleep time I call it:)
You can add many different scenarios you want.

You just need to change the PHASE with something…
Could be voice, a swtich, time, timer, condition, TV status, LUX etc…


#11

You could always cheat …
I used to write these complicated pistons until I discovered the power of someone else doing the work for me. :slight_smile: I discovered the Rooms Manager smartApp and Now I just use some iris smart plugs with power metering and some rules to set the mood when power level is above x on device y.

The app owner is @bangali

“Work smarter, not harder.” – Allan F. Mogensen


#12

Yes I use rooms manager in the bedroom also. But I am moving everything over to hubitat and I wanted to See if I could do it with a piston. So far my piston has worked. The only thing I haven’t tried is if I change the colour and dim the lights if they stay that way. But last night the lights did stay on while we were watching TV.


#13

@pcgirl65 if you are using wC on HE recommend not installing rooms on the same hub. hubitat runs locally with limited resources and unlike ST will not be able to handle the load from both wC and rooms running on the same hub.

thanks for being a rooms user. :slight_smile:


#14

Good to know! I hadn’t got that far yet but I will keep this in mind. I am using WC because it seems easier for me to use as opposed to RM. I can’t seem to wrap my head around that one.


#15

Is it better to use RM than WC with hubitat?


#16

@jp0550 who did most of the work migrating wC to HE is probably the best person to address this. i dont use wC on my HE hub or RM for that matter.