Turn offf lights but not back on?

I searched for a while now but I can’t seem to find a certain community smart app that I read a month ke ao back. Basically. When a sensor goes off turn off the lights, then turn back on only if they were on before.

what do you have right now?

Most likely it was webCoRE https://community.webcore.co

I currently am staying in my parents basement and no lock on door Right now have it so that when the basement door opens (contact sensor) it changes some lights to red and turns off any others so it looks like we are sleeping. I would like it to turn back on after the door closes but I don’t know how to without sometimes turning lights on that weren’t on before.

what routine are you using right now? piston?

i have a piston that works the opposite way, i.e. when sensor is triggered the bathroom light comes on… you can probably just reverse it…