Skip to content

Instantly share code, notes, and snippets.

@artistro08
Created August 21, 2026 12:36
Show Gist options
  • Select an option

  • Save artistro08/05d868b4350040023233d3002af2a5b4 to your computer and use it in GitHub Desktop.

Select an option

Save artistro08/05d868b4350040023233d3002af2a5b4 to your computer and use it in GitHub Desktop.
Gradually increase light brightness to a target time, adjustable duration, start brightness, selectable weekdays
blueprint:
name: Gradually Increase Brightness By Time
description: >
Lights turn on at a starting brightness, then ramp up natively
(light.turn_on transition) to reach target brightness exactly at
finish time. Duration adjustable.
domain: automation
input:
target_lights:
name: Lights
selector:
target:
entity:
domain: light
finish_time:
name: Finish time
description: Time lights should reach target brightness.
selector:
time: {}
duration:
name: Duration (minutes)
description: How long the ramp takes, ending at finish time.
default: 15
selector:
number:
min: 1
max: 120
unit_of_measurement: min
mode: box
start_brightness:
name: Starting brightness
description: Brightness lights turn on at before ramping up.
default: 1
selector:
number:
min: 1
max: 100
unit_of_measurement: "%"
mode: slider
target_brightness:
name: Target brightness
default: 100
selector:
number:
min: 1
max: 100
unit_of_measurement: "%"
mode: slider
days_of_week:
name: Days to run
description: Days this automation is allowed to trigger.
default: [mon, tue, wed, thu, fri, sat, sun]
selector:
select:
multiple: true
options:
- label: Monday
value: mon
- label: Tuesday
value: tue
- label: Wednesday
value: wed
- label: Thursday
value: thu
- label: Friday
value: fri
- label: Saturday
value: sat
- label: Sunday
value: sun
trigger:
- platform: time_pattern
minutes: "*"
variables:
duration_raw: !input duration
duration_min: "{{ duration_raw | int(15) }}"
start_brightness_raw: !input start_brightness
start_brightness: "{{ start_brightness_raw | int(1) }}"
target_brightness_raw: !input target_brightness
target_brightness: "{{ target_brightness_raw | int(100) }}"
finish: !input finish_time
condition:
- condition: time
weekday: !input days_of_week
- condition: template
value_template: >
{{ ((today_at(finish) - now()).total_seconds() | round | int
- (duration_min * 60)) | abs <= 30 }}
action:
- alias: Turn on at starting brightness
service: light.turn_on
target: !input target_lights
data:
brightness_pct: "{{ start_brightness }}"
transition: 0
- alias: Ramp up to target brightness by finish time
service: light.turn_on
target: !input target_lights
data:
brightness_pct: "{{ target_brightness }}"
transition: "{{ duration_min * 60 }}"
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment