Send notification on device contact open every time interval until contact closes


#1

1) Give a description of the problem
I want to send a notification (push/SMS/contact) once a switch is open for a defined time, then repeat the message every set amount of time.

2) What is the expected behavior?
Send a notification if the contact is open for 10 minutes, the repeat every 10 minutes until it is closed. Also, update the amount of time it has been open in the message.

i.e. Once the contact has been open for 10 minutes send the message, “Door has been open for 10 minutes.”

Then if it stays open for an additional 10 minutes, send the message, “Door has been open for 20 minutes.”

Once the door is closed, discontinue messages.

3) What is happening/not happening?
I get a message immediately once the door opens. I thought of setting a variable and incrementing it every set amount of minutes when the switch turns on, and set the variable back to 0 once it turns off.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS THEN HIGHLIGHT ALL OF THE LOGS SND CLICK ON THE </> ICON TO FORMAT THEM)


#2

you should check out this example piston