Door Left Open Reminder - Configurable by Individual Contact


#61

So at this test, my first notification was 14 minutes, and my second notification was 29 minutes. Soooooo, the times actually were right, but the distance between them, and why they came at those times is a mystery. Your recommending I import your last piston?

Ill do that then now…

So if I am understanding correctly. If I have the window dooralerttime set to 10 and the doorrepeattime set to 10…the msgs should come like this…Kitchen window opened for 10 minutes, Kitchen window opened for 20 minutes…etc.etc.

The same idea would be, if I had the window dooralerttime set to 10 and the doorrepeattime set to 15…the messages should come…Kitchen window has been opened for 10 minutes, kitchen window has been opened for 25 minutes, kitchen window has been opened for 40 minutes…

IS that correct?


#62

So I think I got things are working pretty good now. When I set the minalertime to 1, I got a better understanding of what is going on.

So my kitchen window test, ran correctly at 10 minutes and then 21 minutes…Which was appropriate. I only been working with one contact sensor up to this point. Tomorrow I am going to add a bunch more, so I hope things still work.

I do have one last question perhaps you can answer.

If the kitchen window is open, and remains open. Then the front door opens…Will Piston B pick up and report the front door? If the report time is less than the kitchen window?


#63

The notification times will vary slightly for a variety of reasons. A minute or two off is not uncommon. That was why I originally rounded the times. It annoyed me for absolutely no good reason. :rofl:

Yes.


#64

@bthrock I’m happy to report, that this morning, after it was such a warm day, and we had multiple doors/windows open, everything functioned as such.

After seeing the piston in motion though, I was thinking of a couple different variations I wanted to try.

The first thing is I would like to make the notification Speak, but only the first time…And then subsequently after that only make it go to sms. I was going to attempt something like this starting at line 65.
Do you think something like this syntax would work?

iF {timeOpenList[$device]} < {doorAlertTimes[$device]}
Then
Speak to Echo.
Else
Send SMS

I am trying to add it, but I cannot figure out how to add in a IF at line 65. I see you have one, for your If’s with presence sensors, but cant seem to track down how to get it in there.


#65

Glad to hear it’s working for you.

You can an ‘if’ anywhere anywhere the words ‘+ add a new statement’ appear in the editing window.

I be misreading your intent, but my first impression is that your ‘IF’ statement isn’t going to work quite the way you want. Unfortunately I’m on the run this morning and will have to take a closer look at a bit later to be sure.


#66

I got it going…Looking forward to growing this thing


#67

I’m looking to add a notification once the door has been closed but at the moment, it’s waiting for the timer to expire to check if the door is closed/open and {doorNameList[$device]} doesn’t seem to work at the point of sending the closed notification. Is there any way to notify as soon as the contact is closed and get that variable to display the correct sensor?
I’m new … please be gentle :slight_smile:

EDIT: it looks like the way this is set, with the minimalAlertTime from the A piston, if my sensor on a 30 minute delay is open for more than that variable, i won’t necessarily get an open notification but i’ll still get one for closed. there’s a lot to digest here. i need to wrap my head around the logic.

EDIT 2: I fixed the device variable for the closed notification and set the minimums to 1 minute. That should mostly take care of my first concerns, however, the first edit still stands.


#68

Hello, I’ve looked these pistons over and over again and can’t see why it’s not sending me the message when the doors are left open. Any thing stand out to you guys? Sorry if this seems simple, but I really don’t have any background in coding. Thanks!!


#69

My initial thought is that adding a ‘door closed’ notification within the body of the original piston is going to be challenging, but since it’s been a bit since your original post can you update me on your progress?. Sorry I haven’t had time to look at this sooner.


#70

There’s a lot to digest with all the changes you’ve made to the original piston as well as some structural issues (like the use of else-if statements) that complicate things a bit. I’ll give it a closer look as time allows.


#71

I toyed with it a bit but got stuck. Since I’m new, I figured I would work my way up to something like this. And since it’s so easy to open the app and check the status of the door, a notification isn’t a major necessity. I’m using it the way you wrote it and it’s working like a champ. Thank you, again, for sharing – really excellent and well thought through code!


#72

For reference, I took the basis of my code from the code kxavier_23 had posted above. I appreciate any ideas you may have! Thanks in advance!


#73

Great piston - BUT: In my house - we often open 3-4 windows at approx. the same time in the morning (within the same minute). Therefore I receive several notifications when we reach the different alert-times.
Is there some way to make sure when either one of the sensor open - start 1 timer. And then after 10 minutes to run a check and provide me with information about which sensors are still open?
I’ve tried several solutions, but the “any of these (window1, window2, window3)” changes to active - start 3 different sequences - and individual notifications 10 minutes from when they are each opened.
Any one?


#74

To be honest, assuming I understand you correctly, I would probably write a very different piston for this purpose rather than attempting to modify the one I’ve posted, which was specifically designed to provide multiple, individual notifications of various open contacts.

Something more along the lines of

If any of ContactA, ContactB, or Contact C Changes to Open
Then
Wait 10 minutes
If any of ContactA, ContactB, or Contact C is Open
…Save Matching Devices to openWindows
Send Notification “The " + {openWindows} + are open” to xxx-xxx-xxxx
Endif
Endif

Obviously you can add a variety of conditions, loops, etc. to match your specifics. There may be some bits and pieces you can borrow from my piston, but in general starting anew may be easier and result in less confusion.


#75

That worked!
Great! Thanks! :slight_smile:


#76

Hi I am new to Webcore and trying to figure out how to get this working. I am struggling with line 81 of Door Left Open Reminder B. The example in the 4wdpg piston lists “Presence Sensor 1” so when either the author or his wife is home a notification will be sent to the person who is home. Where do you establish what Presense Sensor 1 is? My wife and I use our phones as presence sensors in smartthings. Which I assume I would replace John Doe 1 and John Doe 3, lines 84 and 88 with each of our presence sensors. I am not sure what I need to enter as my specific value for “Presence Sensor 1” Thanks.


#77

Without a green snapshot of your piston, it’s hard to be sure what you’re working with as those line numbers don’t match up with the original piston. Save the piston and click the green camera icon either above or below it and post that.

My suspicion is that you have made modifications or have an undefined (global) variable, but you’ll really need to post the snapshot for me to help you.


#78

When you edit the device part of the line, you’ll get a drop-down list of all your devices. Your phone presence device will show up as something like Your Name’s Galaxy Note10.


#79

Here is my screenshot. Sorry, I did not know the line numbers would change. Line 75 is where I need help with selecting the correct value.


#80

I see how to use the values, but my confusion is what value to select. The piston is supposed to determine who is home and send a message to the person who is home. The sample piston note said it is supposed to watch for the author and his wife so I would expect (2) values to be in line 75, (1) for each person’s presence sensor, but there is only one value. I do not know what i should list there. I posted a screenshot about of what I have input so far.