I am trying to use two motion sensors on one switch


(James L) #1

This is my first try on creating a working piston, but I am trying to get the light switch to go off only after both motion sensor show no motion.
What I have does not work so any suggestions would be appreciated.
I would also like to be able to put a time delay in there.

I have tried change from active and change to inactive and neither works.

Thanks


(Bob) #2

Change it to all of … are inactive.

THEN
Turn Off

If you want a delay you can do :-
IF
All of … stay inactive for 5 minutes
THEN
Turn Off

Or you can say
all of … are inactive.

THEN
Wait 5 minutes
Turn Off


(James L) #3

Thanks Bob

From what I can tell it is working. I haven’t tested the time delay but with two sensors I may not need it.
Ignore the milliseconds its just the for while testing the function.

Thanks again,
James

Does it look like what you recommended.


(Bob) #4

Why are you using the same sensors twice.
I think you have misread my statement above.
When I said OR I meant a different way of doing it.
I’ll post one.
What I would recommend is that you change Task Cancellation Policy (TCP) to 'never for that action.
This way if motion is detected before the timer has matured the timer will cancel and start again when no motion is detected.


(James L) #5

I must of misunderstood however mine did appear to work. Like I said I’m new at this.
Is this what your looking for? Thanks for the example.

I don’t quite understand
"What I would recommend is that you change Task Cancellation Policy (TCP) to 'never for that action.
This way if motion is detected before the timer has matured the timer will cancel and start again when no motion is detected."


(Bob) #6

You have used 'change to inactive.
I used ‘are inactive’. There is a difference between the two.
Also you haven’t changed TCP to 'never.
Copy mine if you wish. Use the code at the top.


(Bob) #7

Also for information, if you look at the bottom of the piston next to the edit button you will see a green camera. Click in that for an anonamised screen shot of the piston. Makes life easier.


(James L) #8

Yeah I did have ‘are inactive’ on the first one and I messed up on the second pistion.

I don’t quite understand
"What I would recommend is that you change Task Cancellation Policy (TCP) to 'never for that action.
This way if motion is detected before the timer has matured the timer will cancel and start again when no motion is detected."

I do not see anything about the TCP.
And on yours what are the faded character on the right like '#5"?


(Bob) #9

That’s just a line number that is useful when debugging using the logs.
As for TCP, when in edit click on the with.
At the bottom you will see a settings cog.
Click on that and then you will see some options.
Click on TCP and select never.
Save.
You will now see red N next to the actions.


(James L) #10

I would of thought the timers would of reset anyway. They seamed to on my previous piston because the lights never went off as long as either sensor had motion. I will try it. Thanks again.

Does this look OK?


(Bob) #11

That looks good to me.


(James L) #12

Sorry to bother you again, but I just had the light go out on me with both sensors showing motion. We had left the room and both motion sensors timed out. Came back before lights were timed to go off. Both sensors picked up motion at the same time and two minutes later the lights were instructed by the piston to shut off.


(Bob) #13

Try it with 'stays inactive for.