Turn off lights, but delay every time motion is triggered

Someone made a post exactly about this “problem” years ago, and is still relevant:

I guess you have searched the forum before posting this question, so i’m not going to mention it.