I’m having trouble thinking of how to set the closed controls on the else side of this piston. I’m shooting for an if the contact sensor has been open for > 2 minutes and changes to closed. I have an idea on how to do it but I wanted some alternate ideas on how to do it.
Sliding Door Kill Switch back on only when just closed
You can also use a else if for it. Then you don’t need the extra if statement in de else (enable complex IF’s in the left top corner). Not sure if that’s your question?
You can combine two conditions for this where the changes
trigger is essentially filtered based on the was
condition that checks how long it was open:
if
contact changes to closed
and
contact was open for at least 2 minutes
I gave that a shot but it still turns back on as a I close the door even if I have the door closed in less than a 2 minute window. What does it compare to for “was open for?”
try this:
if contact sensor contact changes to closed
and
previousAge([contact sensor : contact]) > 120000
This is what I have at the moment. The problem I’m running into is any time I close the door it activates instead of only if the door was open for 2 minutes.
I just checked it. I opened it for 2 minutes and closed it, it doesnt turn on. Then I open it for 2 secs then close and it kicks back on.
Hmm, the way I see it, Set to Auto to should be in the then right after line 40, not in the else.
Something like this for the else…
else
if
Contact Sensor 3's contact changes to closed
and
Contact Sensor 3's contact was open for at least 2 minutes
then
with
Thermostat 1
do
Set to Auto
end with;
end if;
end if;