Piston - light not turning off if motion triggered, works if manual


#1

1) Give a description of the problem
I want to turn on lights if motion is triggered, and turn off lights if no motion is sensed for 60 seconds. It works great if I manually turn on the light either via switch or trigger in SmartThings, however if it turns on via motion the light never turns off.

2) What is the expected behaviour?
If the light turns on, whether manually or via motion trigger, turn off automatically if no motion is sensed for 60 seconds.

3) What is happening/not happening?
Light is not turning on when triggered by motion event, works fine if turned on manually.

**4) Post a Green Snapshot of the piston![image|45x37]


#2

Here is the basic structure I recommend (two blocks in a single piston):

IF Sensor's motion changes to active
    Then Turn on light
END IF

IF Sensor's motion stays inactive for 60 seconds
    Then Turn off light
END IF

Note, I do not see a reason for Keypad 2 to be a trigger in the OFF block…
IE: If Keypad changes to on, then Turn off Keypad
(this is poor logic, and should not be used with devices!!!)

Although if you are careful, it is OK to to that with Simulated Switches…


#3

Thanks a bunch for the guidance! Guess I was over complicating it, I tend to do that. It’s working better now but with the opposite issue, if turned on manually and the motion is not triggered it never turns off. But that’s much better than before. Appreciate it.


#4

If it is turned on manually, and nobody walks past the motion sensor, then yes, it will not turn off.

You could add another block to the bottom to catch those events:

IF Light stays on for 10 minutes
    Then turn off light
END IF

Alternatively, you could adjust your placement (or angle) of the motion sensor to better aim the sensor.
(so it definitely sees you)


And, of course, another option is:
When you manually turn on the light, it can be turned off manually as well.
(some people prefer this approach)


#5

Manual? That’s crazy talk! Ha ha


#6

LOL, I know, I know…

…but it does make a bit of sense for a manual over-ride to be turned off manually…
(although I like the safety net: IF Light stays on for X minutes, then turn off)