Adding a delay in for handling an event
-
Hi all, I have a site that I have it's internet connection OFF most of the time, to conserve battery power.
When I get an urgent event or alarm, I need to turn on the Internet, and send an email.
The issues I have is that I need to add a delay between the time the event occurs, and the email is sent, to allow the router and satellite receiver to boot.
I have tried using Javascript in a Meta data point, but can't get that to work.
It would be good to have a delay option in "Event handlers".Does anyone know the best way to do this?
Thanks
-
Hi Hayden,
What went astray with the Meta point? That would be my recommendation, as you can call
RuntimeManager.sleep(3000); //stop here for 3 seconds
Which can allow you to encode delays.
In Mango 3.3 both the email and the set point event handlers have scriptable options, and you can invoke
RuntimeManager.sleep(milliseconds);
from within them. -
Thanks Phil,
I was using the "Take timestamp, add delay, and then check to see if current timestamp was greater than that value".
It didn't work in that environment.I will give the RuntimeManager method a go, thanks.
H