Turn off AC (with delay) when door/window is open


#1

Noob here, just getting into webcore.

1) Give a description of the problem
i want to add a delay to an existing piston i found on this forum. The backup code for the original piston is phi29

2) What is the expected behaviour?
Turn off the AC only if door/window contact is left open for 15 seconds.

3) What is happening/not happening?
There is currently no delay in the current piston as far as i know

**4) Post a Green Snapshot of the piston!

5) Attach logs after turning logging level to Full
8/14/2019, 2:31:27 PM +605ms
+9094ms ║Piston waited at a semaphore for 9014ms
8/14/2019, 2:31:16 PM +145ms
+9606ms ║Piston waited at a semaphore for 9516ms

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

Just add a wait command above the turn off command… it’s found towards the bottom of the same drop-down list where you selected the turn off command.

Also, please don’t use imgur to post images, they don’t have great posterity and links break over time. Instead please upload your images directly to the forum (I fixed that for you above).


#3

Will the wait command just delay the turn off command, or will it check if the doors/windows are actually closed first before initiating the turn off command.

When i BBQ with guests over, they constantly open and close the door, or sometimes just leave it open. I dont want the AC to be turning on and off every few seconds. I am trying to get it to wait atleast 15 secs and check if the door remains open within that timeframe before the AC actually turns off


#4

You can add the wait, as Robin mentioned, and then the next line can be an indented IF to check the status of the doors/windows. That internal IF will not be checked until after the wait has expired.


Alternatively, you can change your original IF to something like this:

IF Sensor's contact stays open for 15 seconds
    Then Turn off AC
END IF

#5

Waits get cancelled if the original condition changes back to false, so the following will work fine:

IF
   Any of A, B or C is open
   AND
   Thermostat is not auto
THEN
   WITH
      Thermostat
   DO
      wait x minutes (this wait will cancel if the conditions above change to false)
      turn off
   END WITH
END IF

If a contact changes to closed and then back to open, the timer will reset and start counting down again from the top.