Thanks for the code and the notes on the side. I did notice the change for the time. I used your example and it looks good. I feel confident it will work Thanks
Correct. I was trying to get “A” to pass through to “B” but needed that time condition. I saw that “B” had the looping logic and getting “A” to set it off was the better way to go; i.e. trying to do that in “B” would be messy. Thanks.
FWIW, I’ve done something similar in my ‘home’ version of the piston, wherein the “B” piston uses a different set of Alert & Repeat times for day vs. night. That approach gives me a bit more granular control for each door and also covers the edge case @WCmore was addressing (when a door is opened before sunset and left open into the night). I’ve never posted it here just to avoid complicating matters, but could do so if there was interest.
I love to see other examples. It helps me to understand how this webCORE environment works.
I had another idea about this type of code. Could I do this to make the trigger for the contacts fire less often?
boolean runMe = false IF runMe AND Door's contact stays open for X min Then Then Do Stuff END IF Every day at $sunset IF Door's contact is open Then Do stuff END IF runME = true END EVERY Every day at $sunrise runME = false END EVERY
Something like that should work. FWIW, I wouldn’t set runMe to false in the top of the piston, but rather to ‘nothing selected’. Although conceptually setting the initial value to false as you have done should work, there are circumstances wherein webCoRE will reset the value to the initial value when it’s not intended.