Motion based lights off not working


1) Give a description of the problem
Lights are turning off when they are not supposed to.

2) What is the expected behavior?
Lights are supposed to go off when there has been no motion.

3) What is happening/not happening?
Light go off after the amount of time set.

As you can see in the above screenshot, when a light is on, and there is no motion in the room for X minutes, the light is supposed to go off, which it does.
The problem I am facing is even if there is indeed motion in the room, the lights still go off once the timer is expired, and not resetting once motion is detected.

I was unable to find a similar post with a resolution.



The way I do motion is simple, yet reliable:

   Any of Motion Sensor 10's or Motion Sensor 8's motion stays inactive for 10 mins
   Turn off Switch 17

There is no need to include the extra conditions, since webCoRE is smart enough to not send an off command to a device that is already off.

Full disclaimer:
I tend to make pistons based around triggers, and not grouped with similar devices scattered around the house as you have done. For example, I would make one piston for motion 8 & 10 turning active and inactive. And another piston for Motion 4 turning active and inactive.

I do this so all 5 rooms are not constantly bombarding a single piston with timers and wakeups scheduled. Your method will likely cause issues down the road when your logic expands.


Thank you!

Are you saying the extra (if on) condition is causing it not to reset the timer?
I do intend on separating them, this is just for testing at the moment,


I am saying that the extra “IF ON” serves no purpose.

Plus, testing a piston with 5 triggers will usually not act the same as if they were in separate pistons. (each trigger runs the entire code from top to bottom, so in your case, any event from your ten devices)

One other observation I just noticed…
Line 22, 44, and 66 will turn off the lights when ANY of the motions go inactive. Perhaps you meant to say ALL here?


ALL was the trick.
Thank you.