Elk or CQC timed event rule?

IVB

Senior Member
Been scratching my head, not sure how I would do this, and whether it belongs in the Elk or the CQC engine. I'm thinking the Elk, but I could live with it being in CQC.

I'd like to execute some CQC actions/Elk Tasks if there's been no motion in a room for (5) minutes. I poked around, not sure where to do this.

Anyone have any ideas?
 

Steve

Senior Member
Just off the top of my head in Elk...

WHENEVER MotionZone IS VIOLATED
THEN TURN someoutput ON for 5 minutes Restart if running

This will keep a phantom output (timer) set for 5 minutes everytime there is motion

then...

WHENEVER someoutput TURNS OFF
THEN do your stuff...

This will look for the timer to turn off which will only happen after 5 minutes of the motion not being tripped

I have not tried it, but the theory hopefully is right...
 

IVB

Senior Member
Oh, clever!

So, thinking this out loud, my primary intent was to turn off speakers and lighting(future) if there's been no motion in a room for 5 minutes. Sounds like this would be trivial as I could have CQC set Output208on if the familyroom speakers are turned on. I could then do;
WHENEVER FamRmMotion IS VIOLATED AND Output208 IS ON
THEN TURN Output207 ON for 5 Minutes Restart if running

WHENEVER Output207 TURNS OFF and Output208 IS ON
THEN TURN Output208 OFF

Further, I could have a triggered event in CQC that says something like
IsFldChangeFor("elk-driver.Output208") send false to the FamRm motion
I guess if I wanted to get complex, I could do an
IsEqual("elk-driver.Output208",False), but the only thing that'd be changing that would be the Elk.

Seems too simple. Am I missing something?
 

Steve

Senior Member
I am going to assume that you would use "IsFldChangeFor("elk-driver.Output208")" to turn off the speakers. You probably could actually even simplify it further if you wanted. In theory, who cares if the speakers are on? Sounds like you just want them to go off after 5 minutes. In that case you can eliminate the whole Output 208 thing. Just use 207 as the timer and when it goes off, have CQC sense that and turn your speaker off. If it is already off, who cares? No big deal, but it will save using 1 output and simplify the logic a bit. I do not control any audio at the moment but I would think this should work...
 
Top