Stuck with piston


#1

Hi everyone.

I’m hoping someone can help. I’m usually pretty good at these things but you know when you keep looking at it and cant seem to get it right…

Ok

I have a hallway with a motion sensor. It is set that when motion is detected the hall light comes on and when motion stops after 30 seconds it switches off.

In the hall i have a front door that has a multi sensor on. This is set that when it is open the light comes on and then when its shut after 30 seconds the light goes off.

I cant seem to get the above 2 in one piston that takes the door as the priority, ie if motion is detected in the hall the light comes on but if then the door opens the light stays on until it is closed and then 30 seconds later the light goes off.

Help very much appreciated.


#2

I think it’s highly possible, just put one in one IF condition, then your motion condition in the ELSE IF, everytime one of them is triggered, the scheduled execution time will be overwritten.


#3

Thanks for the suggestion. I have tried that but doesnt seem to work, may be just me though!


#4

On mobile right now but my first thought was use a variable to keep track of when the the light is turned on by the door and the hallway motion piston will use that variable as a condition. If it’s false then go in with the light on for 30 seconds, if true, let the door segment take control.

Make sure door segment sets variable back to false after light off.


#5

Thank you. Ill take a look.bit never used variables before! I think my house is goin to explode!


#6

If you get stuck, post a green snapshot of the piston(s) and let’s have a look.


#7

hey,

im still stuck with this. below is what i am currenly using. what happens is that if the motion sensor is activated and then the door opens it doesnt register it as a seperate action as the piston has already been triggered.

i think i know what i need to do. i need to create 2 pistons. one simple one for the front door ‘if open = on if closed wait for xminutes and then off’ and then a second one for the motion sensor ‘if motion detected and if front door piston status is false then x’

i cant figure out how to create a piston on the status of another. help very much appreciated!


#8

I was playing with this yesterday but forgot to post this test piston… see if this works for you.


#9

Thank you for this. i have set it up but the only thing that this will not do is keep the light on for the duration of the door being open. once i open it the 60 seconds starts and then turns off.

It also will not work with the motion sensor at all. is there a way you can create a separate piston that you can refer to a different piston?


#10

ive had a little play and the below seems to work. i have in the smartthings app a simple if door open light on and if closed light off and teamed with the below seems to be working ok… thoughts?