Lux and motion not working

I have the following piston set up to turn my bedroom lights on when there’s motion and when it’s dark and between the hours of 5:45 AM and 8:55 PM during the week. It works fine the first time it fires - the room is dark, it knows it’s dark, it sees motion and the lights come on. But they go off after 2 or so minutes even though the sensor still sees motion. I’m guessing it’s because the light level now is above the threshold I have set.

My question is, how do I get it to look at lux once and only once per piston fire. After the lights go out for no motion, I’d want it to evaluate lux again.

Try “Motion is not active” and then set TCP “Cancel on Condition or State Change”

What this will do is…

When motion stops, it will start the timer for 2 minutes. If no motion happens it will turn off light. If motion happens then it cancels the timer until no motion happens again. The way you have it is any time you have motion inactive it will turn off regardless if you still have someone in the room.

I can change the condition to “Motion is not active” but I don’t see anything for TCP or “Cancel on Condition or State Change”. How do I set that?

Sorry, Under the section that has your “2 Minutes”, scroll to the bottom. There is a section called Advanced Options. Under that is “Task Cancellation Policy”. Clink on that and you will see the option I told you about,

OK, thanks. Updated my piston - we’ll see what it does tonight

Thanks much!

I use the Fibaro sensors and what I have done, I created a virtual switch - so if lux is smaller than 20 it switches the switch on and if higher than 25 it turns it off … in my piston I only use the virtual switch state - works just fine and you dont have lux measures triggering the piston

Can you post your piston so I can see how you do that?


Since I hate creating VS for things that are not “doing something”, I like to use variables to accomplish the same thing.

If lux is less than than 20 then set variable (boolean) {whatever} "True"
If lux is greater than 20 then set variable (boolean) {whatever} “False”

Now in the piston, you can use the variable just like you would do any other switch VS.

If variable (booleal) ="True"

Set all of this up with the same Basic Piston in Expert Mode with an “Or” separator between conditions or groups.

Here you go

I dont think Booleans can be used across multiple pistons can they @rontalley ??

If you put an @ in front of the variable then it becomes global and can be used across multiple pistons. “@variablename” I often use a Basic Piston in Expert mode and use Or separators for conditions or groups of conditions when dealing with multiple scenarios dealing with the same device(s). This way I can keep everything in one Piston using the Cancel on Piston State Change for each When True or When False action.

1 Like