Help find existing SmartApp - control of lights that may already be on

I think there is an existing SmartApp that does this, but I can’t find it so I’m looking to see if anyone out there knows…

Need an app that will “smartly” control lights that may already be on. Example - We have a recessed light right outside a coat closet. I want to put a sensor on the door so that when it is opened, that light comes up to full brightness (it’s a dimmer). If it is already on, I would like it to return to its previous brightness when the door is closed (probably a minute later, actually). If it was off, I would like it to turn back off.

I thought I remember seeing an app that did this. It could be the food coma I’m still in from the holidays and leftovers!!!

You asked the same question back on Nov. 1 in this thread: Code to not turn lights off that are already on. The app there could easily be modified to do what you want.

I thought I did…but I couldn’t find the post. Ugh…sorry about that!