How to turn off light after elapsed time?

I’ve created a automation task that turns on my x-mas illumination after sunset. What can i do to switch it off automatically after 8 hours?

In the same automations, there is an action called ‘wait for time to pass’
But 8hrs is a lot of waiting, Why not create another automation that swicthes of at sunset + 8 hours?

Use a Sun Trigger with an 8 hour offset.

    - platform: sun
      event: sunset
      offset: "08:00:00"

Thanks i’ll try that also. Even if i know that under the hood it all goes into yaml files, i’ve started using automation tasks with the GUI.

Right know i simply added another task switching off the lights as midnight. But i think of a solution which turns them off depending on time an presence. Maybe like “if nobody moves in living room after midnight, turn it off. But if there is movement, wait until it stops, but force turn off at least at 01:00 am”

Wow, that’s way complicated?!