Returning lamp to original state after any one of 3 sensors may have changed its state


#1

1) Give a description of the problem
If 3 motion sensors can turn a light on, how do I make sure that only 1 turns it off?

2) What is the expected behavior?
Return light to original state if turned on by any sensor, but only in the morning

3) What is happening/not happening?
Not sure how “inactive” states are handled when multiple motion sensors are capable of turning the light on. I want the light to go back to its original state after all sensors are quiet. This piston hasn’t been tested, I’m just unsure how to approach this problem using multiple sensors and I ran into similar conceptual issues with handling events in another piston. This time I thought I would ask about doing it the right way.

4) Post a Green Snapshot of the pistonimage
(UPLOAD YOUR IMAGE HERE)


#2

You can use the system variable $currentEventDevice to tell which one of a group of things kicked off your piston.

However, when I look at this piston I see that it does not really have any triggers in it. Only conditions. So WC is using several of your conditions as triggers. So you might get unintended results.

I would make your first statement read like:

IF any of Motion1, Motion2, or Motion3 changes to Active

Then you’ll have that as your one Trigger to start the piston.

You can also say “all of” the devices change to Inactive.

IF all of Motion1, Motion2, and Motion3 change to Inactive

That will only be true when all three of them go back to being Inactive. If 2 were already inactive the whole thing is still dependent on the last one going back to Inactive…so it will still work.