How to realize a Light Timer - Timer or delay or

Hi
actually i move my config from openhab to home assistant. now i want to setup the lights. the lights are controlled by motion sensors. what is the best way to realize a light timer? with timer or with delay?
i don t need a frontend and i dont need to adjust the time.
the only thing i need is if the light is switched on by motion, and the motion sensor fires again the timer should be restarted.

any ideas???

Like this: