How to set automatic presets for lights?

Dear people,

I want different lightning profiles for the time of the day. How would i achieve this?

For example:
During the day, brightness 80%, color white
After sunset, brightness 60%, color red
Midnight till 6 o’clock 10%, color red

Ok so this is my config:

alias: Turn on the lights
description: ""
trigger:
  - platform: time
    at: "07:00:00"
  - platform: sun
    event: sunrise
    offset: "-10"
  - platform: sun
    event: sunset
    offset: "+10"
  - platform: state
    entity_id:
      - group.presence_home
    for:
      hours: 0
      minutes: 0
      seconds: 0
  - platform: state
    entity_id:
      - sensor.outside_dark
condition:
  - condition: time
    after: "06:45:00"
    before: "23:00:00"
action:
  - if:
      - condition: and
        conditions:
          - condition: state
            entity_id: group.presence_home
            state: home
          - condition: state
            entity_id: sensor.outside_dark
            state: "True"
          - condition: sun
            before: sunset
    then:
      - service: light.turn_on
        data: {}
        target:
          entity_id: light.floor_led
    else:
      - service: light.turn_off
        data: {}
        target:
          area_id: living_room
        enabled: false
  - if:
      - condition: state
        entity_id: group.presence_home
        state: not_home
        for:
          hours: 0
          minutes: 0
          seconds: 0
    then:
      - service: light.turn_off
        data: {}
        target:
          area_id: living_room
    else: []
  - if:
      - condition: and
        conditions:
          - condition: state
            entity_id: group.presence_home
            state: home
          - condition: state
            entity_id: sensor.outside_dark
            state: "True"
          - condition: sun
            before: sunset
            after: sunset
    then:
      - service: light.turn_on
        data: {}
        target:
          area_id: living_room
    else:
      - service: light.turn_off
        data: {}
        target:
          area_id: living_room
        enabled: false
  - if:
      - condition: or 
        conditions:
          - condition: state
            entity_id: sensor.outside_dark
            state: "False"
          - condition: state
            entity_id: group.presence_home
            state: not_home
    then:
      - service: light.turn_off
        data: {}
        target:
          area_id: living_room
    else: []
mode: single

I also built a sensor (sensor.outside_dark) which checks if it’s dark outside, based on if it’s cloudy, dark or rainy or the sun has set.

use scenes

then call them in an automation useing scene.turn_on


# Example automation
automation:
  trigger:
    platform: state
    entity_id: device_tracker.sweetheart
    from: "not_home"
    to: "home"
  action:
    service: scene.turn_on
    target:
      entity_id: scene.romantic

Ahh like that, so i set the different scenes and configure their presets and activate them according to their trigger and condition? Thanks

This is one of the first automations I made for Home Assistant, and it’s still working perfectly!

Nice…
I guess that was the only way back then?
But I’m afraid a bit over complicated nowadays, especially for newbees :wink: