Vacation lights piston review


#1

Is there something missing/wrong in this piston (inspired by other pistons I found on this forum)?

The problem seems to be that lights might end up staying on all night. I assumed all commands within the same “DO” block (turn on, set level, wait, turn off, wait) would be executed if the “while” condition is true.

Is that not the case, i.e. is the “while” condition checked for every individual command (which may result in the last turn off NOT to be executed)?

Thanks


#2

I guessing that the ‘Tile is between’ statement might be the culprit? Seems like it might fire unexpectedly and disrupt the ‘while’ block before the ‘Turn Off’ gets executed.


#3

The piston looks fine to me. None of the commands (turn on/off, random waits, etc.) will get scheduled to run past midnight, per your time condition. My Away Lighting piston does pretty much the same as yours and execution times do not get scheduled past the time conditions … it’s been working fine … since early 2017.

However, ST scheduling being what it is, I added commands to turn off the lights again, just after the “Time is between …” range … just in case :wink: