New user lighting question

Hi all, New to HE. I would appreciate any advice concerning this:
I have Hue dimmable lights and a door/window sensor on a door. I created a Simple Lighting rule to turn on the lights when the door is opened and turn off after waiting 5 minutes. No problem with that and it works fine. I would like to add a condition that the action (turn on an off after 5 minutes) is not performed if the lights are already on.
Can this be accomplished in Simple Lighting or is Rule Machine needed and if so how would I check for the lights being on.

Thanks for any help.

Unfortunately, Simple Lighting is a bit too simple for this. If you have a motion sensor you also want to use for the lights, you could use the Motion Lighting app (it has options for contact sensors, but I don't think it can work with contact sensors alone--but importantly for you, it does have options to not turn lights off if they were already on). If you don't have a motion sensor, you could fake it: install and use this app (provided helpfully by a Hubitat staff member) to create a virtual motion sensor from your contact sensor, then just set up Motion Lighting with this virtual motion sensor.

If you'd rather not do that, you certainly could use Rule Machine. You'd need to somehow track whether the lights were already on when the sensor was opened, which you could use some kind of variable for (the rule's built-in Private Boolean is true by default and setting it to false would be one way you could track that, then check its value before turning off, then reset it; there is probably an example in the documentation but I could also provide one).

Thank you for your quick response, I will check into Motion Lighting App.

I think this should do what you want as if I undertand correctly if the lights are already on you don't want the rule to actually run.
image

1 Like

Thanks, I'll give this a try.

Note that this will turn the lights off five minutes after the door opens, not five minutes after it closes. I assumed that is was not what you want.