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.
Door Left Open Reminder - Configurable by Individual Contact
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 Then Do Stuff END IF Every day at $sunset IF Door's contact is open Then Do stuff END IF runME = true END EVERY Every day at $sunrise runME = false END EVERY
Thanks
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!
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.
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)
Does this work for lights left on? Locks left unlocked?
I am trying to use this piston with my Inovelli light switches and Schlage locks. Neither of them are returning any messages.
Everything works fine with my door contacts. Attached is a screenshot of my configuration.
Also on line 24, 25, and 26 I noticed some devices not listed in doorsToCheck (line 17). They are all devices I selected when testing out but no longer need them to be monitored.
Similar logic could be used for lights or locks, but the piston would have to be revised because, as currently written, it checks the status of the device’s contact instead of switch or lock, as you can see on lines 56, 58, and 91 of your snapshot. I’ve never really given this any thought as lights and locks are easy to turn off or lock remotely if they’ve been on or open too long, but I would probably create separate pistons to accomplish this to avoid complications.
Also, note that you have an error on lines 40 and 93, as the originating piston is not correctly specified. If the originating piston is not paused and resumed, the “B” piston may not always behave as expected.
With regard to lines 24-26, on the snapshot you provided those are fixed variables, so I don’t think those are the lines you intended to reference. My suspicion is that you meant to reference one of list variables below the line that says “Do Not Modify.” If so, then what you’re describing is normal. Clearing and/or stuffing list variables has been a hot topic around here for a while, but I don’t recall if the issue was ever fully addressed. In any case, while it’s annoying, it’s also harmless.