Switches and lights automation for other automations

I’m trying to make an automation to simplify my other automations.

I have groups of switches and i have groups of lights in groups.yaml, i also have automations that runs switch.turn_on and
light.turn_on

It’s repeated in several automations.

What i want is an automation that turns lights and switches on, that i can call from other automations.

So something like this, i haven’t gotten to work though:

  alias: "switch and light on"
  action:
    - service: switch.turn_on
      entity_id:
        - group.window
    - service: light.turn_on
      entity_id:
        - light.tronika_dimmer_zv_9101_level

And call that like this:
- id: lights_on 
  alias: "Turn on lights"
  trigger:
    platform: sun
    event: sunset
    offset: '-00:45:00'
  condition:
    condition: time
    before: "22:00:00"
  action:
    service: automation_start
      - id mixed_light_on

The last bit after service i just made up to make my point.