Wait until the next door opens


#1

1) Give a description of the problem
I created a piston that will turn an outdoor light on and disarm SHM when either of two presence sensors comes home. It also sends push notifications to two phones. The light then turns off two minutes after one of two doors has closed (meaning one of us has opened the door and come inside).

2) What is the expected behavior?
See above.

3) What is happening/not happening?
It actually seemed to work how I expected when I tested it.

I’m just wondering if there’s a better way to write the piston so that after the light is turned on, it’s waiting for the next door open—>close event to use as a trigger to turn the light off. Anything beyond simple if-then rules is tough for me to come up with on my own.

I’m also curious how I could tweak it so that it only sends a push notification to the same person whose presence sensor was the one that arrived.

**4) Post a Green Snapshot of the piston!


#2

Well not really sure what you’re asking but i know how to send the sms to the person that arrived. I’ll show it later :wink:


#3

I guess what I’m trying to confirm is, the way the piston’s written, there’s kind of two phases, and are they linked correctly?

From the beginning til line 37 happens all at once when one of us comes home.

Then if someone opens and closes the door 10 seconds later? 1 minute? 5 minutes?

Is the door closing, and the trigger to turn the light off, linked to the first part of the piston (up to line 37) over any of those time frames?


#4

Doesnt matter what happens, if the contact sensor 4 or 7 is closed it will be waiting 2 minutes to turn off switch 10


#5

OK. Is the door closing linked at all to the first part, including the presence sensors arriving?

You’re saying it’s not right?


#6

Part of my confusion is, I don’t think I understand whether pistons always execute from top to bottom.


#7

It does but it will see that the switch changed to closed and will turn off the lights after 2 minutes
So here you can see a example, the button will still toggle the light


#8

In your piston, you have several sets of conditions for controlling your light. But then you also have a trigger for turning it on and off. It’s one piston but the trigger towards the bottom isn’t really related to the conditions above it.

Am I right? Sorry, I have no experience with computer programming so can’t really get my brain to work this way all that easily.


#9

Just send me your questions in a PM, i will try to explain it :wink: