Turn off light unless already on?

Hi everyone. I'm unsure of which app to use to accomplish what I want to do, but I have seen similar questions being asked.

I have a garage door tilt sensor and a shop light that is controlled via a Z-wave dimmer and am using Simple Automation to turn the shop light on if the tilt sensor changes to open and then turns the light off after 5 minutes and that's working as expected.

However, what I haven't figured out is how to NOT turn the shop light off after 5 minutes if it was already on when the tilt sensor reports open. I created a restriction to disable the rule if the shop light was already on, but the light still turns off after 5 minutes even if the shop light was already on.

Can I do what I want to do using a Simple Automation rule? If so, how? If not, how should I go about accomplishing what I want to do e.g. only turn light off if it wasn't already on?

I've attached a screenshot, but not sure if there's a better way to show the settings for the rule.

Thanks for your help.

What do your logs say? Having the disable restriction should work the way you have it. If you wanted to use Rule Machine, this is fairly straight forward:

Required Expression
Shop lights are off

Triggers
Tilt sensor opens

Actions
Turn on shop lights
Wait for Event - 5 minutes Elapsed time
Turn off shop lights

The required expression in rule machine will prevent the rule from running if the lights are already on.

3 Likes

I'm not a Basic Rule user, but I'm wondering about that "Restrict only the trigger of this rule" option you have enabled...

My guess is that might be applying the "Disable when light on" restriction to literally only the trigger, but not the subsequent "turn off" portion of the rule.

If you remove/disable the "Restrict only the trigger of this rule" option, does the rule work as hoped?

If the tilt sensor on the garage door triggers the garage light to turn on, the rule does not care whether the light was on or off when the trigger occurs. The light will turn on (or stay on) and then turn off after 5 minutes or whatever delay is set.

In order to keep the light on after that 5 minutes are up, there are a couple of other options.

  1. Set a restriction that says the garage tilt sensor should be ignored if the light is already on.

  2. Get yourself a couple of motion sensors that will detect movement in the garage and turn the lights on when motion is detected. The reason you need two or more motion sensors is that any vehicle parked in the garage is likely to block the ability of the motion sensor to see movement in some parts of the garage. I have one motion sensor on either side of the parked car such that the lights do not turn off when I am working in the garage with the garage door closed. Getting caught in the dark when the lights go out can be unnerving. If you park two cars, you might need three motion sensors.

I much prefer the second option as it insures that you do not forget to turn the lights off when you no longer need them.

1 Like

Thanks for the suggestions everyone. I ended up deleting the rule and then re-creating it and with, I think, the same settings as before and it's now working as I expected!

Thanks

david

1 Like