Best way to turn off different groups at different times of day with same trigger?

I have a single ‘house off’ automation that I run when someone requests to do so within the house. I want this to by default turn off all the lights/tv/etc in the house; however…

  • If it is bedtime, I want it to turn off all items except delay turning off a few lights on the path from our living area to the bedroom for around 5 minutes, so we aren’t walking around the house in the dark.
  • If it is during the day, turn off all items, but keep the mudroom lights on for a short delay to get our coat/shoes on before leaving.

Is there any easy way to do this? I’ve tried getting clever with groups, but this gets complicated and easy to mess up.

Thanks in advance.