🖥️ActiveHome Pro > User-Designed Working Macros

Motion sensor and lights on/off

<< < (2/4) > >>

bkenobi:
I was thinking that P1 must also be a dummy module since you can't turn on a motion sensor.  I'll try the advanced command to see how that works.  I saw there was a category there and actually played with the RF command, but didn't realize there was a PLC command in there.  Thanks for the suggestion!

Noam:

--- Quote from: bkenobi on February 07, 2011, 03:07:57 PM ---I was thinking that P1 must also be a dummy module since you can't turn on a motion sensor.  I'll try the advanced command to see how that works.  I saw there was a category there and actually played with the RF command, but didn't realize there was a PLC command in there.  Thanks for the suggestion!

--- End quote ---

Just create a "dummy" for P1, too.

bkenobi:
Hmmm, I just realized this doesn't do exactly what I thought the description was saying it did.  This setup will:

1) Turn on a light when motion is detected.
2) If no motion is detected during the 5 minute delay, it will turn off the light and reset.
3) If motion is detected during the 5 minute delay, it will continue to count down the time until the 5 minutes is up.  It will then set a new 5 minute delay and repeat.

As a result, this will, in most situations, keep the light on for 10 minutes from initial motion.  It does not leave the lights on for 5 minutes after motion, it actually turns the lights off at LEAST 5 minutes after the last motion.  This is probably not a big deal, I just didn't understand that initially.

FWIW, I did get this working with the use of 2 dummy modules.  Thanks for the help!

aussie mate:
I have just programmed and tested the series of 4 macros in this post. - It works well...

I didn't use any dummy modules - just 2 flags and 4 macros.
P1 being the sensor and P3 as a trigger using advance functions commands.(you could use a dummy module here if you wanted to).

It works as follows:
1) Turns the light when motion is detected. (sensor P1 as trigger)
2) If no motion is detected during the 5 minute delay, it will reset flags and turn off the light.
3) If motion is detected during the 5 minute delay, it will reset flag 2 only
4) while the 1st macro will continue to count down the time until the 5 minutes is up.  It will then send the P3 On command - which will have 2 results.
5 a) if no motion has been detected in the last 5 mins - it will run the "no motion during delay"
macro and turn light off.
5 b) if motion has been detected in last 5 mins - because the flag was reset (step 3) - it will restart the 1st macro (step1).

Thus the lights will always stay on until 5 mins after the last movement was detected.

Noam:

--- Quote from: aussie mate on February 13, 2011, 05:31:53 AM ---... Thus the lights will always stay on until 5 mins after the last movement was detected.


--- End quote ---
Based on my reading of it, I don't see how it would work if the motion lasts longer than 5 minutes.
The only 5-minute delay is in the initial P1 macro - if the room is dark.
The second one - the one that gets triggered by P3 - has no delay in it, so it won't ever trigger P3 to turn the light back off.

Am I reading this wrong?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version