Turn Lights off when illuminance increases

Hi, I am trying to create a rule that turns my kitchen/diner lights on when motion is detected and turns them off after motion stops for 2 minutes. The conditions I want this to happen under are only between sunset and sunrise (+ or - 15 mins), or at any time of day if the illuminance falls below a set value.

This is what I have come up with so far, but the problem with this rule is that if, for example, the lights are on because illuminance was low, but the illuminance increases during the 2 minutes wait to turn them off, then at the next motion detection the whole rule is skipped and the lights never turn off.

I know why it's behaving like this - but can't figure out a way to make the lights go off after 2 minutes, even when the rule no longer applies because none of the conditions of time or illuminace are being met. Any help would be appreciated!

Many ways to do this. One way would be to remove the first IF and add it as an AND to the second IF statement.

IF motion is active AND (Time between sunset and sunrise OR Illumination <45)
Cancel delayed actions
Turn on lights
ELSE Turn off lights --> delayed 2:00 (cancelable)

Motion lighting should do that all for you

1 Like

Yep. Motion Lighting. So much simpler. As they say, KISS,

1 Like

Do you really need the luminence trigger? I guess the luminence could be low during normal daylight hours if there is a severe thunderstorm or a total eclipse of the sun, but those are not frequent occurrences in most places.

Typically, sunlight starts to fade before sunset. It also takes a while for the sun to come up in the morning. Thus, rather than using sunrise and sunset as your time triggers, you can use a time offset. For example, you can have the motion turn on the lights anywhere between 30 minutes before sunset (or whatever suits you) and continue until 30 minutes after sunrise. Then see how often the luminence trigger is needed.

The more complex a rule, the slower it will execute and the more opportunity there will be for failure. Just because you can do something does not mean you should. Keep things as simple as possible.

Agree with this. Motion lighting has options to restrict based on times of day and illuminance. Creating a rule manually in rule machine isnā€™t necessary, unless perhaps one is particularly motivated to learn how to use rule machine.

Outdoor illuminance, sure. But indoors, it can really depend on other factors. Shape of the house, location of windows, nearby trees, not to mention personal preferences re: whatā€™s ā€œenoughā€ light indoors. In my house, a cloudy day can render some areas dark enough to warrant turning lights on.

Nothing incorrect about that statement generally, but IMHO the addition of a lux restriction to a motion lighting rule is not actually worth worrying about or avoiding, if the use case calls for it.

1 Like

I have lights in my main room programmed to come on when light the starts to go. On cloudy days they can come on an hour or more before sunset (the room is dark at one end) but on sunny days when the light streams in the windows it can be up to an hour after sunset. The Motion Lighting rule I use is actually quite simple. Tun the lights on with motion, but only when lux is low. Canā€™t think of a simpler way to do it. RM seems like a sledgehammer to crack a nut in this case!

All that complexity to save, what? Maybe $5/yr. :wink:

I know, I know... It isn't a need, it is a want. I do get that.

1 Like

So simple... I just couldn't get my head around it! I will give that a try, thanks :slight_smile:

I couldn't figure out how to get the two conditions to work in Motion Lighting... i.e. when there's motion, turn on the lights if between sunset and sunrise OR at any time if the Lux is below 45.

You're forgetting the value of the Happy Wife, Happy Life which I also believe is known as WAF - priceless!

I suppose. My wife would be fine with turning the lights on/off manually. :wink: