Wait until condition is met?


#1

Hello again!

I have a piston that after a certain time of night after motion has stopped I want various things to happen, lights, locks, vacuum. I can do all this easily, however, I want to add the caveat to not run the vacuum until after a certain switch has turned off (if it was on when the piston initially triggered).

Is there a way to trigger the piston normally, but have the vacuum portion of it not run until an extra condition is met?

Thanks as always guys!


#2

It’s hard to say without seeing your piston, but it sounds like all you need to do is add this to the appropriate section:

IF
CertainSwitch is off
THEN
WITH Vacuum
Turn on

(Although this will not vacuum if you turn off CertainSwitch an hour later)

Alternatively, you could remove the vacuum portion from that piston entirely, and make another piston something like this:

IF Time is after 21:00
AND
CertainSwitch turns off
DO
Run Vacuum

#3

IF
motion is inactive
AND
time is after x
THEN

with lights
Turn of

with lock
Lock

repeat
Wait 5 minutes
UNTIL
some switch is off
when true - run vacuum
OR
time is after Y
when true - log warm - vacuum did not run before set time