Trigger new piston to run once after global variable has been a value for a certain time

Im surprised I am having such an issue with this. If I have a global variable, I have another piston that monitors it and kicks off a certain set of actions. I don’t want it to fire right away, I want it to wait for a certain time. The issue is whenever I build it to wait for a certain time, it runs continuously after that (since it has been in that state for at least that long).

I know the error of my ways, but I can’t figure out how to do it. Simply I want:

If {@globalvariable} changed to 1 3 minutes ago
do this.

Obviously there is no way to have a piston subscribe to the event but then delay running that I can tell. The only other way I can think of doing it is by cascading more variables (which seems silly) or by having a timer but then you’d have to re-verify the condition, which also seems inefficient. Ideas?

I’m just picking up Core to try and solve a similar issue;

Broadly, I have 6 lights that are turned on and off by ST, but sometimes, one or two of the lights remain on, when they should be off.

My plan is to use a Global Variable like a flag. Raise it when piston 1 detects one or more lights on when they shouldn’t be (my motion detection triggers another virtual switch), then if the flag is raised, run piston 2 to wait X amount of time, before shutting down the lights, and dropping the flag back down to zero.

I’ve still a lot to learn, but figure we could share info!

Check out the WebCoRE community forums for examples and assistance…

All good - figured it out…

Have two pistons; “Check lights” and “Clean up lights”.
Piston 1 is a basic, and keeps an eye for the conditions that any lights are on when the switch “Bathroom Day” or “Bathroom Night” are both off.
If that is met, then wait 5 mins, before triggering Clean Up Lights.
Clean up lights is a follow on piston (one that doesn’t check for its own status unless fired by another piston); and it checks again that the switches are off and lights are on - we don’t want to plunge someone who has just walked back in to the bathroom in to darkness - and if that’s still true, turns the lights off.

Yeah I am still experimenting with it as well. More than one way to skin a cat. I found good success with global variables. I have had one trigger kick on another trigger but sometimes I don’t have them actually fire, I pause them and then wake them with the ‘control piston’ as I call it. But when I wake them, sometimes they don’t fire. Really all I want is to have a piston subscribing to lets say 6 devices, each one puts up it’s hand when it closes, when all 6 close, it starts a timer, after 3 to 5 minutes it goes OK no one is in that room / area of the house and executes. I just haven’t had that much luck with ‘stay’. Also I figured ‘contact did not change’ would look at the events log and see if there was a ‘motion’ or ‘contact’ event or whatever I specified after a certain amount of time. Doesn’t seem to do that, at least mine with some trial and error seems to be referencing the health state.

Still working out out as well.

As JKP mentioned (and in another post, I didn’t check this one first, sorry JKP) there is a new community up and running. Seems much easier to find help and info than searching one huge deprecated thread for piston help. haha