![]() |
|
Send Alert if Gate is left open - Printable Version +- Comfort Automation/ Security System Forums (https://www.comfortforums.com) +-- Forum: Support (https://www.comfortforums.com/forum-2.html) +--- Forum: Comfort Installation and Programming Guide (https://www.comfortforums.com/forum-124.html) +---- Forum: Responses and Actions (https://www.comfortforums.com/forum-92.html) +---- Thread: Send Alert if Gate is left open (/thread-5603.html) |
- darnold - 01-19-2025 I am trying to write a response to check if an automatic gate has been left open for more than an hour. I would like Comfort to send an SMS alert (or email) to alert that the gate has been left open (I could also have it close the gate instead...but at this point I just want to raise a notification). I have written the following response to open the gate: If Input Gate = 0 Then Open Door 2 1 10 Set Counter001(1) = 0 Do GateOpenCheck End If It calls the GateOpenCheck response: If Counter Counter001 > 60 Then Send SMS PhoneNo01 1 ! Send an alert that the gate is open Set Counter001(1) = 0 Do GateOpenCheck Else Increment Counter001(1) If Input Gate <> 0 Then Do GateOpenCheck After 60 Seconds Using Timer01(1) End If End If This is a recursive response which I believe is okay. Just wanted to make sure this will work as expected--i.e., every hour that the gate is left opened it will send an alert. - slychiu - 01-20-2025 The gate open check response is going to increment the counter every minute until it reaches 60 minutes so that part seems correct. it does not cause an endless loop. However if you close the gate, that does not stop the counter from counting up. You need to add a response to stop the timer 1 in Input Gate off response |