More than 1 entity in script service, what am I missing?

I am trying to learn how to script in HA but here is something I don’t understand. This script does not work and it seems that it has to do with the two entities in the switch.turn_on service call. Is it not possible to have more than 1 entity in a service call?

twilight_lights:
  sequence:
  - service: homeassistant.turn_on
    data:
      entity_id: group.fonsterbelysning
  - service: switch.turn_on
    data:
      - entity_id: switch.vardagsrum_skap
      - entity_id: switch.allrum_bordslampa
  - service: light.turn_on
    data:
      entity_id: light.hall_garderob
      brightness_pct: 2

Afraid not.
But you can have the service multiple times.

Or you could have a group. Or a scene.

Check! Thanks!

It’s definitely possible to have more than one entity ID in a service call.

- service: light.turn_on
  entity_id:
  - light.light1
  - light.light2
    ...

or

- service: light.turn_on
  entity_id: light.light1, light.light2 ...

gah.

My bad there. :frowning:

Requires slightly different formatting from what OP said.

Personally, I’d still suggest a group or scene, but that’s mostly to simplify my automations file. But yes, I was wrong.

Ah! So it was my formatting… Thanks!