Pending Cancellation?


#1

1) Give a description of the problem
Not really a problem…other than in my own head.
What’s the best way to do what RuleMachine called ‘Pending Cancellation’?

2) What is the expected behavior?
If THING1 turns OFF
Then turn THING2 OFF; as long as THING1 does NOT come back on again within the next minute.
i.e. THING1 coming back on again within that minute would, in effect, cancel the command to turn THING2 off.

3) What is happening/not happening?
Well, I’ve tried it a number of ways, and I think I figured out a way of getting it done, but I just want to know what the best way is.

**4) Post a Green Snapshot of the piston![image|45x37]
I will later if need be, but for now, I mainly just want to see/hear how you experts do it, and go from there.

**5) Attach any logs (From [ST IDE]
NA

REMOVE BELOW AFTER READING


#2

You could write it up like this:

IF Thing 1 stays off for 1 minute
THEN

When Thing 1 turns off it will send a notification to his piston that it has just turned off, which will in turn cause a Timer to start and wait for 1 minute. If Thing 1 stays off for the full minute the next steps will execute.

Does that fit your needs? I hope I read your requirements properly.


#3

Thanks.
So…first…this may help me solve something else I’ve been wondering about too…
Are you saying that I don’t need to have a separate condition for keypad 8’s switch turning OFF…I can just say IF it stays OFF for x-time?

I was thinking that I had to build pistons to first watch for the switch to turn OFF, and then have them watch for if it stays off. However, if the ‘if it stays off’ already covers the issue of watching for it to turn off, then I think that solves this issue (as well as others).


#4

Correct.

Either way can be done really, it’s just one more command.

IF thing 1 changes to OFF
and
Thing 1 stays OFF for one minute

The first is a Trigger, the 2nd is a condition so those will work together on the same IF block.
Or you can just say:

IF thing 1 stays off for 1 minute

In the absence of any triggers the piston will use this condition as the trigger which will cause the piston to run.

One note of caution though… Be sure you account for what the steady state is otherwise you could have the piston running ALL THE TIME. So if you don’t want it looping back into itself you usually need to add some other logic to account for that.