Comfort  Automation/ Security System Forums Home
Home Search search Menu menu Not logged in - Login | Register

Send Alert if Gate is left open
 Moderated by: admin
 New Topic   Reply   Printer Friendly 
 Rate Topic 
AuthorPost
 Posted: Sunday Jan 19th, 2025 01:14 pm
   PM  Quote  Reply 
1st Post
darnold
Member
 

Joined: Thursday Feb 26th, 2009
Location: United Kingdom
Posts: 37
Status: 
Offline

  back to top

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.

Last edited on Sunday Jan 19th, 2025 01:16 pm by darnold



 Posted: Monday Jan 20th, 2025 01:07 am
   PM  Quote  Reply 
2nd Post
slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 5759
Status: 
Offline

  back to top

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



 Current time is 02:57 pm
Top




UltraBB 1.172 Copyright © 2007-2014 Data 1 Systems