When Hue light not on...do this...? But what is 'not on'?


#1

I’m trying to bring over some pistons from Core. But one aspect never worked right there, so I want to do it right here.

I want a motion sensor to trigger a light on with motion, and then off (wait 50 seconds) if motion ceases (cancel on condition change). If the light is already OFF. I want nothing to happen if the light was previously on.

The piston runs fine when the light is off, But it still triggers when the light is on. Either adjusting levels or shutting them off when motion changes to false. I have always used the condition/restriction of Switch is Off. But perhaps that is the wrong thing for Hue bulbs. With Hue, my physical in the wall switches are always on. Does that make a difference? I’ve also tried Level = 0 and that didn’t seem to work at all. Does anyone use a…if light is already on do nothing sort of scenario? And what do you use to indicate bulb off?

I don’t have a tested piston in WebCore yet. I drafted one today, but it looks different (had Latching in Core). And I’m not sure where to put the if motion goes off section in this style.(so this may be wrong here) But really, I’m not so much asking about that for this piston, as just determining how to make it work with knowing when the Hub bulb is on or off when the physical switch is always on.

Thanks


#2

Try this.
The red N in the with is for TCP so that while there s motion the light will not turn off.
If there is motion in the 45 seconds between motion becoming inactive and 45 seconds maturing the timer will stop then restart when motion stops again.
Use the code at the top of the piston.


#3

Something like this…


#4

@bobbles, @whoismoses

Ok, so you both agree that Hue bulbs do work with Switch is Off as a condition. The rest of the piston works fine, but still triggers when the bulbs were already on. That is the problem that I can’t seem to get around. I was wondering if I was using the wrong condition for Hue bulbs. But you both agree that Switch is Off is the correct one.

Thanks. Guess I’ll see if it works better in WebCore than it did in Core.


#5

I don’t use smart bulbs anymore.
The example I gave you is how I would do it with my light switches.
I’m assuming smart bulbs would work the same.
Good luck.


#6

I don’t have Hue, I have LIFX. The bulbs should report their status back and the piston should work (not run when the bulbs are on). Not sure why it doesn’t.

When it runs when the bulbs are on, are both bulbs already on?