Controling light with motion detector not triggering macro multiple times???

Started by Ericmil8, August 10, 2009, 03:35:57 PM

Previous topic - Next topic

Ericmil8

I'm having issues with coming up with a macro used with motion sensors. this is what i would like to do with the macro.

when motion is detected (A15) i would like lights (P4) on to 100% for 30 seconds, then Dim to 25% for 30 seconds then turn off. However if motion it detected again i would wait the 30 seconds from then, then dim and then 30 seconds later turn off.

the issue I'm having right now is if the trigger is detected again(A15) before the macro is done it starts running a second copy of the macro. so there are Multiple dim and off commands being generated.

Any ideas?

hawk1

There are probably many ways to do this.  But to start with the problem your having right now:  Use a flag status in your macro.  Something like this: (doesn't have to be exactly like this, just an example)

A15-trigger
check flag status clear-condition
set flag 2
P4 on
delay 30 sec
dim P4 25%
delay 30 sec
P4 off
clear flag 2

that should keep it from firing again.  Then you can work on the other stuff.
koopr@sstelco.com, I don't know what I'm doin but I'm havin fun doin it!

SMF spam blocked by CleanTalk