This piston, which is in two parts, provides an alert (and subsequent reminders) if doors, gates, or even windows have been left open beyond a defined amount of time. It is configurable by individual contact, meaning that both the amount of time each contact can remain open before a notification is sent, as well as how often a reminder is sent after the first notification, can be different for each contact. This is useful if, for example, you want to monitor the front door very closely, but don’t care if the garage or other door stays open for a much longer period.
The piston is designed to continue monitoring all of the defined contacts until all are closed. Thus if the front door is left open, and ten minutes later the side gate is left open (because the kids are just not paying attention today), you will receive separate notifications for each based on whatever times you have assigned them. If one of the doors is later closed, the notifications for that door will stop but the notifications for any others will continue according to your schedule.
I hope I’ve included adequate commentary in the pistons themselves for anyone who might be interested in something like this.
Edit: 03-10-2018: Revised timeOpenList[ ] variable from string to integer. This does not affect the piston function, but ensures consistency with the type of comparisons allowed by WebCoRE.
Edit: 11-19-2020: Minor revisions to simplify/declutter original piston and update push notifications for consistency with new ST App.