Turn Light Off After X Amount Of Time Unless Triggered

Hello I am trying to get a light to turn on and stay on for 5 minutes when my garage door opens. I can do this with a few apps.

Mainly though I don’t want it to turn off if the lights are already on or if I switch them on after it opens. I know this is possible, but can not figure it out.

Any help would be appreciated.

Go to Marketplace and on SmartApps tab, under Lights and Switches, you will see an app called Smart Light Timer. I think that’s what you need.

I tried that, but it didn’t function quite right and turned my lights off no matter what and only after the door closed instead of opened.

Any help?

That’s weird. I use Smart Light Timer for almost the same thing (mine is triggered by “normal” house doors instead of a garage door, but it works exactly like you described you want it to work.

Try this smartapp by @bravenel

1 Like

Awesome thanks for the replies! I will try out the Smart Light Timer again and if still no luck I will look into using the other method listed.

Appreciate the help.

I tried it again and it turns the lights on, but it never turns them back off.

Thank you so much for posting that. Works great! Online thing that would be nice is if I manually flip a switch that it could cancel the auto shut off. Is this possible somehow?

Just thought I would check back and see if anyone had any other ideas on a way to cancel the timer with switch. This looks possible with the overwrite runIn command, but no idea how to implement it at all.

What is it you want to do? That little app starts the timer unless the light was already on at the moment of being triggered. So now what, the light is triggered to turn on, and will turn off after x minutes. What is it that you want to do to cancel the timer? The light is already on, so you would need something else to trigger cancelling the timer. What is that something else?? Unfortunately, using the light switch won’t work, because it’s already on.

Gotcha makes sense. However I have a switch that is separate from the devices that turn on when the light turns on for x amount of minutes. I’m wanting to cancel this countdown timer if I turn on a switch so the lights do not turn off.

Hopefully makes sense and I’m not sure if possible or not, still learning.

Yes, if you have a different switch, that can be used. So the logic would be as follows:

The trigger turns on light #1, and that starts a timer (unless it was already on). Now, switch #2 turns on, and that action cancels the timer. That’s simple to do. I could make that mod in just a few minutes if this is what you want.

Yes that is exactly what I am looking for, just couldn’t figure it out. It would be greatly appreciated.

OK, it’s done, same file as above. Just follow the link above to get the updated copy, then copy/paste into IDE to install. Let me know if it works for you! :grinning:

Okay cool I will definitely test this out here after awhile when I can. Thanks again for the help. I will post back with the results.

The “Optional switch to cancel” is looking for text input like assigning a name, but you can’t choose a switch.

Must be a typo. Give me a minute…

Haha, I found where the typo was after I went back and looked at the code.

I give, what’s the typo?