Door Left Open Reminder - Configurable by Individual Contact


Thanks for the code and the notes on the side. I did notice the change for the time. I used your example and it looks good. I feel confident it will work :slight_smile: Thanks


Correct. I was trying to get “A” to pass through to “B” but needed that time condition. I saw that “B” had the looping logic and getting “A” to set it off was the better way to go; i.e. trying to do that in “B” would be messy. Thanks.


FWIW, I’ve done something similar in my ‘home’ version of the piston, wherein the “B” piston uses a different set of Alert & Repeat times for day vs. night. That approach gives me a bit more granular control for each door and also covers the edge case @WCmore was addressing (when a door is opened before sunset and left open into the night). I’ve never posted it here just to avoid complicating matters, but could do so if there was interest.


I love to see other examples. It helps me to understand how this webCORE environment works.


I had another idea about this type of code. Could I do this to make the trigger for the contacts fire less often?

boolean runMe = false

IF runMe AND Door's contact stays open for X min
        Then Do Stuff

Every day at $sunset 
    IF Door's contact is open 
        Then Do stuff
    END IF

    runME = true

Every day at $sunrise
    runME = false



Something like that should work. FWIW, I wouldn’t set runMe to false in the top of the piston, but rather to ‘nothing selected’. Although conceptually setting the initial value to false as you have done should work, there are circumstances wherein webCoRE will reset the value to the initial value when it’s not intended.


I have the below two pistons working correctly except for two issues related to notifications. First, in line 74 of the “B” piston, I had my wife’s phone number and she would never get the text message, so I replaced it with the push notification. Any idea on why she would not get the message? Second, I’m using two Echo Dots as a speakers but I can’t get any notification from Alexa. At the bottom is another piston I’ve successfully set up to notify from the Echo but I’d like to merge that notification with this one. I’ve tried Speak, Speak Text, Speak Text and Restore, Set Volume Speak and Restore, etc. and none seem to work.


A few months ago, SmartThings blocked all SMS outside the US… and initiated a strict daily SMS limit to US numbers. Plus, each number will not receive any texts until we reply with (I think it was) YES to the ST number. This grants permission, but the other restrictions still remain…

Amazon does not want Alexa to be controlled by other devices. Any method to get her to talk, is a hack.

Here is the method that I use to get voice alerts.

Pro Tip:

This thread is in the “Example Pistons” category, and is not normally used to troubleshoot. If you are having issues, please create a new thread in the “Piston: Design Help” category…


Thanks for your reply. Regarding the Echo Dots, I have successfully configured Echo Speaks and had it working in the last piston that I posted a photo of. The difference seems to possibly be a prescripted message that was working vs. a variable message that I was trying to get working in the second photo. I read through some of the thread you linked to and it did seem like you could get them to speak a dynamic variable. If so, do you know what might be the issue? Is the “send notification” on line 78 necessary?


I figured it out. I was testing it with both presence sensors at home. I removed line 69 and it worked.


I’m just starting to build my smart home so don’t have much experiences with webcore.
I would like to ask you for help with customizing this code.
I have a line:
integer[] alertAlexaStart; /* {“Bathroom Window”:“45”, “Bedroom Window”:“45”} */

and want to create a new integer list with the same content but the time for each item in array should be greater by 10 so the line should looks like this:

integer[] alertAlexaStop; /* {“Bathroom Window”:“55”, “Bedroom Window”:“55”} */

I tried to set variable alertAlexaStop by this way but it doesn’t work:

Set variable {alertAlexaStop[$device]} = {integer(arrayItem((doorIndex)-1, (doorAlexaTimesCold)+10))}

Please help, Thanks!


Problem solved.


Sorry … just saw this. Glad you got it resolved. :smile:


Hey thank you! I’ve been looking for a piston like this. I’ve tried making my own several times but it always would mess up whenever they were multiple devices involved.


I have a piston that works very well, I’ll leave it here for anyone who wants to use it, the push message is in Portuguese.


Yes, a simple piston like that will work for a single device. However, the example piston being discussed in this thread allows the user to monitor multiple devices simultaneously while allowing for individually configurable timeouts and notifications, which is a much more complex task.

Both have their respective uses, of course. As I monitor this thread to support anyone may be attempting to use the original piston, it would be preferable to me if we not introduce other pistons that might take the thread off-topic. :grinning: :+1:


I’m new to Webcore so please bare with me. I’ve imported both pistons and they test successfully in the IDE, however, I’m not sure how to setup notifications. When I try to configure the contacts for notifications, mine shows as having no contacts. Is there a place I put in a phone number?


The contacts feature in SmartThings has been disabled and is no longer available. You’ll have to revise the piston to send notifications directly to a specified number.


To add a bit to what @bthrock said:

Send PUSH Notification = Sends a ST app notification to all phones connected
Send SMS Notification = Sends a text to a US number. (limit 50 per day)


You can also look at using services like pushover with appropriate drivers