Door Left Open Reminder - Configurable by Individual Contact


Thanks for the help. I will test it out today and let you know how it works.


@bthrock Hello, how would I add the time of contact open to this. So when the push is sent it says door has been open since 8:30pm which is 30 minutes? It is the time of open that I cannot figure out how to do.


I do not use this piston, but generally speaking:

IF Door's contact changes to open
    Set variable {string} = $time
    Set variable {string} = " "   <-- This clears the time when the door closes

IF another trigger happens
    Send PUSH notification = "Door has been open since {string}"


That is actually exactly what I did, but every time it runs, it gives the current time and not the time it opened.


I cannot see what is stored in {doorsToCheck}, but keep in mind that every execution above will set a fresh new {timeOpened}. (line 47)

My advice was to set the variable only at the moment the door opens.
(not at every execution)


Here is the whole thing, where would I put it? Line 61?


Ahhh… That piston has no triggers

How are you planning on detecting when the door opens if you are not subscribed to that event?


Same setup as in this post, 2 pistons, there is the Trigger piston.


That one could partially work…

I mean, the $time will always be 2 minutes off, and will not properly set unless the Location is Disarmed… but it’s fairly close to your goal. (you could always +2 at a later time to find the precise time)


so stick at line 27 and make it a global variable?



You are tracking multiple doors here… but have them all sharing a single variable

This means each door opening will overwrite the previous times on all the other doors.


ok, this is getting complicated, maybe I just go with the minutes opened, lol.


My apologies. I generally only have a single trigger per piston…
(Which allows for MUCH more elegant coding possibilities)


I appreciate the help, I usually do as well, trying something new here. I am 95% what I wanted, should be good enough.


@wcmore I was curious, is it possible in the message expression to subtract the {timeOpenList[$device]} from $time ? If possible that would give me what I need.


This was essentially what I was going to suggest when I read your original post this morning. I’m happy to help, but I don’t want to work with or through the modifications that have been suggested thus far. @WCmore’s advice is usually solid, but in this instance his lack of familiarity with the piston is complicating matters unnecessarily.


@bthrock Thank you for helping. My 2 pistons are exactly as you have them in post #1. I have removed the 1 variable that I created. The only thing I have changed is the push notification to give me the minutes instead of the rounding you had.

I am not good with expressions at all, how would you do this?
The #s are set at 2 for testing only.


Please… by all means. I was probably out of line by trying to help in your thread, LOL


To display the time the door was opened the expression would be:

formatDateTime(addMinutes($time,-timeOpenList[$device]),“h:mm a”)

You can, of course, modify the time format as needed.

Also, with each of your PUSH notifications be sure to add “and store in messages” to maintain compatibility with the new ST app. Once you have it working you can, of course, modify or simplify the notifications section as needed.


I’m generally happy for any help I can get because I don’t always have the time to jump in. You and I may have a few differences in how we approach some things, but usually end up in the same place. This time, however, when I started reading my eyes kind of popped open. :joy:

I’ve been meaning to post an updated version of this piston to reflect the changes needed for the new ST app and to simplify/declutter the notification section, but I keep getting dragged away elsewhere. Guess I’ll have to get on that now.