Turn off light after no motion

I want to turn off some lights after there’s been no motion for X minutes. I’ve tried Simple Automation Rules, but if the rule is to turn off after 5 minutes, motion starts at T=0, stops at T=1, and starts again at T=3, the lights will still go off at T=5 rather than T=9. I also tried Motion Lighting, but that didn’t seem to do anything. Probably doing something wrong.

I assume one of those apps or another basic one should work for this simple use case, just struggling to handle the obvious edge case of motion restarting after it stopping resetting the timer.

Happy to post screenshots if that helps.

Could you post a screenshot of your rule(s)?

This should work:

1 Like

Thanks, that worked! Motion Lighting I also got to work. I guess Simple Automation Rules just doesn't have the "and stayed inactive" ability.

1 Like

I approached this a bit differently . ... outdoor lights on at sunset to 15% (just a glow), off at sunrise. BUT if motion is detected brighten to 99%, then back to original 15%.

In rule engine, I have a "sunset" rule and "sunrise" rule to turn the lights on (and off) (I'm not able to upload pics, so hope description is OK):

  • at sunset, turn outdoor lights on to 15% (i just want a glow, not a full bright)
  • at sunrise, turn outdoor lights to 0%
    -both these rules have predicates of either "between sunset and sunrise" or "between sunrise and sunset"
  • both rules have a trigger of "every 5 minutes" - this will become clear later

I have a motion rule where

  • predicate is sunset - 20 minutes, and sunrise + 20 minutes (to avoid motion rules from firing outside that time. (I also have motion sensor lux setting set to 50 or 75 to avoid motion detection during the day, and lux update set to 30 minutes)
  • trigger is motion
  • set outdoor lights to 100%
  • pause sunset and sunrise rules

and an inactive rule where

  • resume rules "sunset" and "sunrise" delayed by 5 minutes. Since the sunset and sunrise are paused while lights are on bright, the 5 minutes interval stops counting. When they are resumed, the counter keeps going, and somewhere following that the lights "re-dim" to the lower level, or turn off if the sunrise threshold has been passed while lights are on.

I wish I could post pictures... Hope this helps someone... :slight_smile:

Here is what I use in the Motion and Mode Lighting app to turn on the front door light when the doorbell senses motion with a 1 minute delay. I have some additional restrictions on mine so it does not turn the light back off if I have all the outdoor lights on, etc...

image

And here is a SUPER simple one for my office that just kicks it on and has a 2 minute delay to turn off. Or if I manually shut it off, it disables the motion activation until the next mode change.

image

Thanks for all the replies.

If I want a rule that turns on lights with motion sometimes but turns off when no motion always... do I need two separate apps for that?

It depends on what the « Sometimes » entails… Depending on the time of day, luminance, etc.?

That makes sense. I just set up Motion Lighting to turn on between two times when motion and off after 1 minute. The off component seems to work even if outside of that time, which is what I want.

Last question on this topic (I think): if I manually turn on when not near the motion sensor (switch, voice, etc.), is there anyway for Motion Lighting (or a different approach) to turn off if no motion for X minutes, even without a “motion stopped” event?

So you are wondering if, after manually turning on the light, it can turn off after X time if no motion is detected?

That might be better achieved in a Rule Machine rule. You could set it to:
Triggers:
Switch physical on
Motion Active

Rule
Wait for X minutes
Turn off the light

Didn’t test it, but I think it should work…. The motion active will re-trigger the rule which will cancel the wait, so the light will only turn off when the motion is not triggered for X minutes.

Thanks, that makes sense. Keeping all that and then adding in the "turn on during certain hours" in RM makes it feel harder to construct properly... :confused:

One option if you want those same lights to be automatically turned on and kept on would be to have a RM rule that pauses the motion rule above and turns on the light at a certain time, then have it wait for another time where it unpauses the motion rule and runs it, so that the lights will turn off, but only with lack of motion.

The platform is extremely powerful - I haven’t yet found something that I needed but that it couldn’t handle, either via a rule or a custom app. Keep asking question - myself and others in the community will be happy to help!

Download the Hubitat app