Multiple light entities turning on with sunset

Who can help?
I have multiple light entities that I want to turn on with sunset and with different brightness.
I tried in an automation but it’s not working.

### Woonkamer lampen aan bij zonsopgang
  - alias: 'Woonkamer lampen aan'
    trigger:
      platform: sun
      event: sunset
      offset: "-00:25:00"
    action:
      service: light.turn_on
      data:
        entity_id: light.dimmable_light_4
        brightness_pct: 80
      service: light.turn_on
      data:
        entity_id: light.hue_white_lamp_1
        brightness_pct: 40
      service: light.turn_on
      data:
        entity_id: light.hue_white_lamp_2
        brightness_pct: 40

And I have an remote switch.remote_woonkamer which also can turn this on and off. Should I create an other automation for that?

You need “-” in front of the services under action - there are multiple services.
ex:

action:
  - service: light.turn_on
    data:
      entity_id: .....
  - service: light.turn_on
....

And since you’re turning two lights on to the same brightness:

    action:
    - service: light.turn_on
      data:
        entity_id: light.dimmable_light_4
        brightness_pct: 80
    - service: light.turn_on
      data:
        entity_id:
        - light.hue_white_lamp_1
        - light.hue_white_lamp_2
        brightness_pct: 40

Great thanks. That’s works. :smile:

Maybe you also know the second thing.
I have an remote, switch.remote_woonkamer. I want to do the same, to put the light on/off with the remote but with the same entities. Should I create an other automation for that? Or can I combine this with this automation?

You can use the same automation to turn the lights on via the switch. Just add another trigger. Then write another automation to turn them off via the switch.

Thanks for the feedback.
But with the extra trigger it won’t work.

    - trigger:
        platform: state
        entity_id: switch.remote_woonkamer
        to: 'on'

That’s not how you add multiple triggers. Try this:

    trigger:
    - platform: sun
      event: sunset
      offset: "-00:25:00"
    - platform: state
      entity_id: switch.remote_woonkamer
      to: 'on'

Yes thanks.
Also forget to and the fire event: true in the config to the switch :roll_eyes:

Thanks all for the quick response.

Not sure what that means, but you’re welcome. :slightly_smiling_face:

Needs to use for rfxtrx remote to trigger an state…

Thanks.