Change Variable based on Contact Sensors staying closed


#1

1) Give a description of the problem
I’m programming a piston to turn off my thermostat when any door or window is left open for 10 minutes. I’d like it to turn back to the previous commanded mode after all contacts have been closed for 5 minutes.

2) What is the expected behaviour? (I always find that 1 and 2 in this template should be swapped)…
The open part is working well, but I cannot get the stays closed for 5 minutes part (3rd ‘if’ statement) to change the global variable.

3) What is happening/not happening?
See above

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
Maybe later…


#2

The timed trigger (‘stays’) is an odd thing. I can’t actually bend my mind to how two of them ANDed together behave. Could you perhaps have ‘All of Contact Sensor 1 and Contact Sensor 2 contacts stay closed for five minutes’ instead?


#3

I agree about the AND part, try OR
or maybe
Try:
If contact sensor 1 stays closed for 5 minutes (Trigger)
Then
IF contact sensor 2 was closed atleast minutes. (Condition)

But I must say,
A lot is happening simultaneously in a single piston. I would split this whole piston into 2 or 3 pistons.