New to Elk rules, night time lighting triggered by motion

MikeB

Active Member
Hey guys -

I'm just finally starting to play with rules on my Elk to control lighting, and wondering if someone could lend a hand.

Ideally I'd like to turn on some lights if the Elk detects motion in the middle of the night. Here are the caveats:
- I want to make sure the Elk doesn't try to turn them on if they are already on.
- I want to make sure the Elk turns them off after 1 minute of no motion.
- I want the rule to be active only between 10pm and 5am.

Here's what I have so far, that somewhat works:

WHENEVER 2nd Floor Motion (Zn 12) BECOMES NOT SECURE
AND AREA ARMED
AND STAIRWAY IS OFF
THEN TURN STAIRWAY ON, FADE RATE = 0 FOR 1 MINS


But here are my questions:
1 - I'm not sure how to specify a range of times (between 10pm and 5am), so I'm running the rule only if the system is armed instead. How do I specify a range of times?
2 - The Elk will turn the light off after 1 minute, even if there is continued motion. How can I have it turn the light off 1 minute AFTER motion is stopped?

Thanks in advance for the help!
 
You could use phantom outputs to set conditions.

Have one output turn during your time criteria. Only have your rule fire based on that output status.

When the light is turned on turn, on another output for 1 minute. When that output turns off have the light turn off.

I'll have to think of the order but thats the gist of it...I think.
It's been a while...
 
Here are Rules more or less:

Whenever every 60 seconds
and hours are greater than 10 PM //the time can be a custom value which can be set from the keypad.
Then turn on Output 100 for 65 seconds //phantom unused output used as a timer

Whenever every 60 seconds
and hours are less than 5 AM //the time can be a custom value which can be set from the keypad.
Then turn on Output 100 for 65 seconds //phantom unused output used as a timer

//output 100 will time out at other times of the day.

Whenever Motion detector becomes not secure
and output 100 is ON //this insures the proper time block
and light is OFF // you really do not need this line because the light will time out and turn off.
Then turn on light for 60 seconds
 
Thanks for the replies!

I think that resolves my time of day issue, but what about resetting the timer every time there is motion?
 
Here are Rules more or less:

Whenever every 60 seconds
and hours are greater than 10 PM //the time can be a custom value which can be set from the keypad.
Then turn on Output 100 for 65 seconds //phantom unused output used as a timer

Whenever every 60 seconds
and hours are less than 5 AM //the time can be a custom value which can be set from the keypad.
Then turn on Output 100 for 65 seconds //phantom unused output used as a timer

//output 100 will time out at other times of the day.

Whenever Motion detector becomes not secure
and output 100 is ON //this insures the proper time block
and light is OFF // you really do not need this line because the light will time out and turn off.
Then turn on light for 60 seconds

Whenever Motion detector becomes not secure
and output 100 is ON //this insures the proper time block
Then turn on light for 60 seconds

As long as the motion detector is clicking secure and not secure the light timer will be set to 60 seconds. When motion ends, the light will time out and turn off in 60 seconds.
 
Wouldn't this be less work:

Whenever Zone 12 becomes not secure
AND hours are greater than 10 PM
AND hours are less than 5 AM
Then turn on light for 60 seconds

Why would you need the phantom output?
 
Wouldn't this be less work:

Whenever Zone 12 becomes not secure
AND hours are greater than 10 PM
AND hours are less than 5 AM

Then turn on light for 60 seconds

Why would you need the phantom output?
Due to the way Elk handles time wrapping at midnight, there is no time of day that is greater than 10 PM AND less than 5 AM.
 
Thanks again for the reply. To be clear, the reason I check the status of the light is that I don't want the Elk to turn it on if it is already on. To be more specific, I'm actually having the Elk turn on a scene that has the light set to 30% (fine as a nightlight). If someone already turned it on via the switch manually I don't want the Elk to override that.

I decided a 1 minute timeout might be too short, so here are the programs I'm using:

\\Nightlight Time Window Start
WHENEVER EVERY 60 SECONDS
AND TIME OF DAY IS LATER THAN 9:00PM
THEN TURN Output 101 ON FOR 1 MIN, 5 SECS

\\Nightlight Time Window End
WHENEVER EVERY 60 SECONDS
AND TIME OF DAY IS EARLIER THAN 5:00AM
THEN TURN Output 101 ON FOR 1 MIN, 5 SECS

\\KitchenMain Nightlight Trigger
WHENEVER KitchenMotion (Zn 10) BECOMES NOT SECURE
AND Output 101 STATE IS ON
AND KitchenMain1 IS OFF
THEN TURN KitchenMainNightlight ON, FADE RATE = 0 FOR 2 MINS

\\Stairway Nightlight Trigger
WHENEVER 2nd Floor Motion (Zn 12) BECOMES NOT SECURE
AND Output 101 STATE IS ON
AND Stairway1 IS OFF
THEN TURN StairwayNightlight ON, FADE RATE = 0 FOR 2 MINS


I'm going to give these rules a shot tonight.

I think I follow the logic, but I don't get the Elk nuances yet that require me to do it this way. I'm sure I'll pick it up eventually. If anyone can suggest a tutorial or other reference that discusses tips and tricks for creating Elk rules, please let me know.

Thanks again!
 
Also, a suggestion - there doesn't seem to be a way to copy rules as straight text into the clipboard. Might be a nice feature to have.
 
I'm going to give these rules a shot tonight.

I think I follow the logic, but I don't get the Elk nuances yet that require me to do it this way. I'm sure I'll pick it up eventually. If anyone can suggest a tutorial or other reference that discusses tips and tricks for creating Elk rules, please let me know.
Your logic looks right to me. One drawback to it is that it will attempt to turn the light on every time the motion sensor triggers, flooding your powerline or airwaves with un-needed "on" commands. You can add a twist to your rules to only send the "light on" command when it is off. To do this you would add another virtual output and keep resetting its timer to 60 seconds whenever there is motion. When that virtual output times out, then send the light off command. There should be rule samples here on CT from a year or two ago.
 
Hi Wayne -

Actually, I do check here:

WHENEVER 2nd Floor Motion (Zn 12) BECOMES NOT SECURE
AND Output 101 STATE IS ON
AND Stairway1 IS OFF
THEN TURN StairwayNightlight ON, FADE RATE = 0 FOR 2 MINS


Or is that not functioning the way I intend?


Unfortunately, the above code did not work for me. The system still turned the light off 2 minutes after the initial turn on (even as I was waving my arms and triggering the motion sensor). It also did not seem to turn the light on reliably.

I'll have to investigate more, hopefully later today.
 
1. I think you need a 'Restart if timer running' where you turn on Output 101
2. Is it a wireless motion detector?
 
1. I think you need a 'Restart if timer running' where you turn on Output 101

Could you tell me where that is?
In the dialog where you turn Output 101 on for 1 min 5 sec there is a checkbox at the bottom that says something like "Restart timer if already running", just check that.
 
Back
Top