Sunset - light on, several lights with different color

Hi all

I am quite new to Home Assistant; worked with Domoticz for years but planning to switch to HA…

At sunset, I want to switch on different lights, but all with their specific color and brightness (so the normal light_on statement is not sufficient). Have tried several options and combination of group, scene, automation; somehow I do not get it to work.

What is the basic structure to set this up?

Thanks for any advice
Heursqem

Here’s what I use, and it works just fine. If you need a different brightness/color for each light, then you would simply add additional services under action to specify each light.

- id: '1556680157829'
  alias: Lights on Around Sunset
  trigger:
  - platform: sun
    event: sunset
    offset: "-00:30:00"
  condition:
  - condition: state
    entity_id: group.TrackedPeople
    state: home
  action:
  - service: light.turn_on
    data:
      entity_id: all
      transition: 300
      kelvin: 3300
      brightness: 255

In other words, you might do something like this:

- id: '1556680157829'
  alias: Lights on Around Sunset
  trigger:
  - platform: sun
    event: sunset
    offset: "-00:30:00"
  condition:
  - condition: state
    entity_id: group.TrackedPeople
    state: home
  action:
  - service: light.turn_on
    data:
      entity_id: light1
      transition: 300
      kelvin: 5000
      brightness: 200
  - service: light.turn_on
    data:
      entity_id: light2
      transition: 300
      kelvin: 3300
      brightness: 255
  - service: light.turn_on
    data:
      entity_id: light3
      transition: 300
      kelvin: 10000
      brightness: 128

Thanks a lot, it is working fine now!

I tried same kind of construction, but now I think because I forgot the ID at the first row it did not work.

Nervertheless, all in good shape now, thanks!