Motion Lighting turn only between two times

Hi, I have 2 Motion Lighting rules, both of them with option 'turn only between two times' set. It works good inside the time frame, it detects motion, it turns on the lights, and after the motion stops plus one minute, it turns off the lights. This happens from one time until sunrise. Good!

The problem is when Simple lighting turns on the lights (evening) outside that time frame. The lights are turned off after motion stops plus 1 minute, Exactly the same as inside the time frame.

Of course 'turn on only between two times' is correctly set, and this happens outside that time frame. If I pause the Motion Lightings, the lights are not turned off outside the time frame selected, so it's clear it's Motion Lighting the one turning the lights off.

Any ideas?

Screenshot of rules and maybe logs are always useful.

Sorry for that. Here are the rules, but I haven't got logs, because the rule has been paused for the last days:

The first thing I will say is I do not use Simple Lighting or Motion Lighting.
Can you set a restriction in the rule you have posted.
Set the restriction to the time you have above that way it should be ignored outside those hours.

EDIT: Just looked at Motion Lighting. Didn't see a restriction option. Maybe use RM instead unless there is someone out there who uses ML and can advise better.

You can restrict Motion Lighting to not turn them off during Evening mode. Does your issue arise because you're using Motion Lighting some of the time and Simple Lighting at other times?

I know RM is the other way, but it looked quite easy with Motion Lighting.

Thank you!

Maybe use "modes to disable turning off" in the motion lighting app, in the "options for additional sensors, light-ff, and off options".

Then have it not turn off during non-night modes.

I was wrong, sorry. I use RM to turn them on and off, and Motion Lighting to turn them on and off when there's motion during a time frame.

I'm not using modes yet, I'm just using time frames. It's easy for me:
if motion and (time frame TRUE)
then turn lights on
wait until motion stops plus 1 minute
turn lights off
elseif motion and (time frame FALSE)
do nothing
endif

Isn't that what 'turn only between two times' should do? It does not.

Thank you.

I'm not using modes yet, but maybe I can give it a try. Anyway, the 'turn only between two times option', I think is buggy. Thanks.

The time restriction applies to turning them on, not to turning them off. Moon Lighting separates options for On from options for Off. It doesn't have an option to only turn them off during some time period. Motion Lighting was intended to be used as the sole app controlling the lights in a room, so you're getting this behavior from using two, If you want that level of refinement, why not just use RM for both during the time period and outside of the time period.

Or, setup modes with Mode Manager to line up with your timeframes.

Or, use a virtual switch to disable Motion Lighting from turning lights off, controlling that switch with your rule.

So, are you saying that 'turn only between two times' limits turning on, but not turning them off?
For me is a strange behaviour, but yes, that makes sense. Now I can understand why it's turning them off.

I will probably use RM, but as you saw from my if then elseif, I will need not less than two, and at least another one to turn them off. :grin:

I will also try your two other suggestions, modes and a virtual switch.

Thank you bravenel.

Best to think of Rule Machine rules like lego blocks. You can build fancy structures, but you need to think it through and construct it with the right parts. Nested if/then/else is actually a fairly rare situation.

With respect to lighting, level per mode, or color temp per mode, or even color per mode will cover the vast majority of cases. You can also do these in Rule Machine, reducing the number of rules you would need.

It's not at all unusual to end up with separate logic needs for on vs. off. For example, turn something on with one motion sensor, but only off when that one and others are inactive. Motion Lighting attempts to cover the lion's share of those -- just haven't seen much need for "only turn off between two times", whereas have seen the need for "don't turn off in this mode".

Designing your modes and how they interact with apps takes a bit of figuring out. You could start with something pretty basic, such as Day at sunrise, Evening at sunset, Night at 11:00 PM (or when some button is pushed).

I've run into this issue as well. To me this is very counter-intuitive to the intention of the Motion Lighting app. For new users especially this makes absolutely no sense and is a source of frustration and a black eye for HE. Why not change that behavior? If I don't want lights to be motion activated during a specific time frame, then it naturally follows that I most likely do not want them to turn off mysteriously for no obvious reason either.

Or at least give that as an option.

Could you explain what is happening that is a problem for you. This is a very old topic and it isn't obvious from your post.

In the Motion Lighting app, setting time ranges for when the lights should activate by motion does not stop them from deactivating on a that same timer. If you set up a ML to only activate a light by motion after bedtime but turn off again after a timeout, for example, it's counter-intuitive to have the same lights shut off by themselves during the evening or other times of the day when you want them on.

That's confusing. Do you mean you want them to come on but not turn off?

Motion Lighting's normal functionality is to turn on lights from motion, and then to turn them off at some point after there is no motion. Is this counter-intuitive? If this functionality doesn't fit your use case, then perhaps Motion Lighting is not the right app to use. Have you checked out Simple Lighting? It can turn lights on from motion but not turn them off.

If you don't want to them to turn off in Motion Lighting there are three options to prevent them from turning off automatically: (1) by mode, e.g., don't turn off in Evening mode, (2) by pressing a button, e.g. when a certain button is pressed they won't turn off anymore until some other button is pushed, and (3) by turning on a switch that disables turning them off.

Is there some other choice that you need?

TL;DR: If ML had easy time restrictions like Simple Lighting, it would work exactly as I want/expect it to.

OK, here's what I wanted: I have a hall dimmer near the kid's room and another at a nearby stair that I want to come on automatically if he/she gets up to go to the bathroom during the night. Another sensor in the at the bottom of the nearby stairs keeps it on while there's motion in case he/she goes downstairs. But I didn't want that sensor alone to initially trigger it (It's the family room so we're there after the kid goes to bed). So Simple lighting won't do that. Then it should shut off by itself after a set amount of time of no more motion.

But during the evening or if needed at other times I want it to stay on. So I set a time range that the motion rule should turn the light on. The turning on by motion works as expected. The not turning on with motion outside the time range works as expected. What is confusing is that the light still turns off on the timer outside of the time range. So someone turns on the light and is surprised that turns off again when they don't expect it.

I see there is an option to keep the lights on if they are already on, but I didn't want that to happen between the night hours. I actually like that the light turns itself off overnight if someone forgets to shut it off. I just didn't want that to happen during the day or evening as the family finds that too confusing. I spent more time than I'd like to admit trying to find out what the problem was.

So if you are open to suggestions, maybe adding simple time restriction options for the rules to activate would make it easier to use.

Here's a simple way to get what you want. Create a virtual switch on the Devices page. Use a simple Rule Machine rule to turn it on during the time window in which you don't want the lights to turn off, like this:

Trigger Events:  Certain Time 7:00 PM
Actions:
   On: new virtual switch
   Wait for Certain Time 10:00 PM
   Off: new virtual switch

Of course use the times you want. Now include that switch in your Motion Lighting rule under Options for Additional Sensors, Lights-Off and Off options,

Meanwhile, I will look into the possibility of adding Don't Turn Off Between Two Times as an option for Motion Lighting.

Like this:

1 Like

This option has been added to Motion Lighting in the latest hot fix release: As shown above, "Don't turn off between two times".

2 Likes