When there is motion, do not turn ON the light, but when the light is ON, KEEP it ON

  • I never want to switch the light ON automatic by motion, I always switch it ON by hand.
  • The light has to turn OFF automatic after X time EXCEPT when there is movement.
  • In some case I will turnoff the light by hand (movement or not)

Today it is working in the rule below but I wonder if there is another way to keep everything in the Hubitat? --> not using the timer of the Shelly device & sending every min when there is motion a POST to the Shelly to reset the auto OFF timer

Setup of the existing hardware:

  • Shelly Relay: I use the auto OFF timer in the Shelly, when the shelly receives the "turn=on", the timer is starting again
  • Sensor: It is resetting every 1 min, so if there is motion, every 1 min is motion detected

Anyone a suggestion?

From your description (manually pressing a button in this area) and your existing rule (which relies on "motion active"), it looks safe to say that there will always be motion in this area, so an alternate way of stating your request is just that you want the light to turn off automatically so many minutes after motion goes inactive but never have it automatically turn on when motion becomes active. (Just making sure you aren't looking for some sort of "timer" where it will turn off so many minutes after being turned on, regardless of whether there is motion.)

In this case, you have a lot of options that could work. An easy one is Simple Automation Rules (formerly called Simple Lighting, which it may still appear as if your hub is on old firmware). A setup like this should do what you want:


You could probably do this with Motion Lighting too, but that's a bit over-complicated for this need. Rule Machine as you're already using could certainly also work, but I like to suggest alternatives unless you need something that only the power of RM can provide.

This is exactly what I do for the two lights my wife never seems to turn off :rofl:

OMG, I am so disappointed in myself :grinning:, this is way too easy, I was stuck in the idea to keep the light ON, thx for helping


Alternatively, would a simple RM rule like the following work as well?

1 Like

That works too, or you could consider:

Triggers: Front - Mutli Sensor becomes active


Cancel Delayed Actions
Wait for events: Front - Multi Sensor inactive
Off: Front- Wall Light --> delayed 0:05:00 (cancelable)

Either should work well--nothing wrong with what you have! The latter is something more like what staff have been suggesting lately as "simpler," so just wanted to throw it out there as an option as well.


Yep. That's even better. Thanks!

I can't tell you how happy I am to find this. I too wanted a way for a human to turn the light on but automation to turn it off when people were no longer around. I found other, more complicated possibilities, tried various rules, etc., none were stable. The thing that worked the best, most consistently (actually hasn't failed yet) is the very similar thing I put together in Simple Lighting. I was afraid I had over simplified and may be overburdening my hub or some such. I am excited to see someone much more knowledgable suggesting this approach. I had to just say thank you!


I implemented the same thing using the motion lighting app.

Turn on a virtual switch that does nothing when it detects motion, and when the motion stops turn off the virtual switch which doesn't do anything but also turn off the actual light.

Ignore the bath mode as it's not needed for the simple operation. The bath mode just disables turning off the light if there's no motion for the specified durartion

Download the Hubitat app