Automation - Toggle two switches betweent 18:00 and 22:00

Hello,

i need some help for programming out holliday lights. I´d like two setup following:
18:00 Turn Switch 1 to on
18:15 Turn Toogle Switch 1 to off AND Switch 2 to on
18:30 Turn Toogle Switch 2 to off AND Switch 1 to on
.
.
.
22:00 Turn Switch 1 AND Switch 2 to off

Whats the best solution?
Is there a way to repeat an automation every 15 Minutes? So i could just say:
switch.toggle.xxx

Thank for helping.

Off the top of my head you can do it like this (I think…it passes the config check at least):

- alias: Holiday Lights Toggle Initialize
  trigger:
    platform: time
    at: '18:00:00'
  action:
    service: switch.turn_on
    entity_id: switch.switch1

- alias: Holiday Lights Toggle
  trigger:
    platform: time
    minutes: '/15'
  condition:
    condition: time
    after: '18:15:00'
    before: '22:00:00'
  action:
    service: switch.toggle
    entity_id: 
      - switch.switch1
      - switch.switch2

- alias: Holiday Lights Turn Off
  trigger:
    platform: time
    at: '22:00:00'
  action:
    service: switch.turn_off
    entity_id: 
      - switch.switch1
      - switch.switch2

I’m not sure how you could do it with one automation unless you always kept switch1 on then just run the toggle. Or there may be a way to set up a service template that checks whether switch1 is on, if it is then run the toggle, if not then turn on switch1 then run the toggle after that. But I’m not sure that’s possible since you always want to start and end with both switches off.

Thank you so much. This will be the Base of our Holiday lights.

I’d add a switch.turn_off for switch2 in the first automation, just in case.