Scheduling lights throughout the day, or over weekends?

Hi,

I’m looking to schedule some lights via HA so that they turn on during the day, and dim at night.

I saw that there’s no in-built point-click functionality to setup complex time/calendar schedules in Home Assistant, but you need to install various add-ons (link). Some other people suggested just using the inbuilt automation framework.

Is that what most people are doing?

I tried doing a simple time-of-day one below - is this an efficient way of doing it via code? Or any tweaks/optimisations to below?

alias: Schedule lights
description: ''
trigger:
  - platform: time
    at: '08:00:00'
    id: start_of_daytime
  - platform: time
    at: '20:00:00'
    id: start_of_nighttime
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: start_of_daytime
        sequence:
          - service: light.turn_on
            data:
              brightness_pct: 100
            target:
              entity_id: light.living_room_lights
      - conditions:
          - condition: trigger
            id: start_of_nighttime
        sequence:
          - service: light.turn_on
            data:
              brightness_pct: 18
            target:
              entity_id: light.living_room_lights
    default: []
mode: single

If you have to setup schedules based on say, weekends etc, or seasons - guessing it might get quite convoluted?

For simple unchanging scenarios the example you posted is fine. You can even replace the the at: times with input_datetimes if you want to easily change the times occasionally. This is what I use because of two things,

  1. the various scheduler third party options were not developed when I wrote most of my config.
  2. my schedule times change so rarely that it’s not worth changing over to a new system. I may do one day.

If you have lots of constantly changing schedules, or just like the point an click user interface, go with the third party integration.