What do you need before you start?
- A dimmable, colour-temperature-capable light in or near the bedroom. A white-ambiance smart bulb is enough, and our best smart bulbs guide covers sensible options. A bulb that only switches on and off cannot do a fade.
- The light already working in Home Assistant, ideally controlled locally over Zigbee, Thread or Matter rather than through a cloud account, so the ramp still runs if the internet is down.
- A recent Home Assistant version. The YAML below uses the current
action:andtrigger:syntax. If you are new to building automations, start with the Home Assistant automations guide. - The Workday integration if you want weekdays only. It is built in and added under Settings, Devices & services.
- The Companion app only if you want the optional phone check at the end; see the notifications guide.
How long should a wake-up light take to reach full brightness?
Around 20 to 30 minutes is a sensible starting point, then adjust to taste. This is a comfort setting rather than a rule, so there is no official figure: a ramp that is too short feels like a light being switched on, and one that is too long means you are mostly lit while still asleep. Start at 30 minutes, then shorten it if you find yourself waking early.
The example in this guide starts at 1% brightness and a warm 2200 K, then climbs to 100% at 4000 K. Home Assistant describes lower Kelvin values as warmer and higher as cooler, so the light moves from amber towards a clearer white as the ramp progresses. Your bulb may not reach those exact figures, because every model has its own supported range, so check the colour temperature range shown on the light's entity page and stay inside it.
Step 1: Create a helper for the start time
A helper keeps the time out of the YAML, so you can change it from the dashboard or the phone app instead of editing code. In Settings, Devices & services, Helpers, choose Create helper, then Date and/or time. Name it Wake light start, tick Time only, leave Date unticked, and save.
This creates input_datetime.wake_light_start. Home Assistant's time trigger accepts an input_datetime entity directly, and a time-only helper fires every day. Set it to the moment the ramp should begin, not the moment you want to be fully awake. If you want full brightness at 07:00 and a 30-minute ramp, set the helper to 06:30.
Step 2: Build the sunrise script
Create a script in Settings, Automations & scenes, Scripts, switch to YAML mode and paste the following. Replace light.bedroom_lamp with your own entity ID.
alias: Wake up light
mode: single
sequence:
- action: light.turn_on
target:
entity_id: light.bedroom_lamp
data:
brightness_pct: 1
color_temp_kelvin: 2200
- repeat:
while:
- condition: state
entity_id: light.bedroom_lamp
state: "on"
- condition: template
value_template: "{{ repeat.index <= 30 }}"
sequence:
- delay: "00:01:00"
- action: light.turn_on
target:
entity_id: light.bedroom_lamp
data:
brightness_pct: "{{ [ (repeat.index * 100 / 30) | round(0) | int, 100 ] | min }}"
color_temp_kelvin: "{{ 2200 + (repeat.index * 60) }}"
transition: 60
The first action puts the light on at the lowest brightness Home Assistant allows, which its documentation gives as 1%. The loop then runs once a minute for 30 minutes, nudging brightness up by about a third of a percentage point each time and warming the colour by 60 K. The transition value is in seconds, and is the documented way to fade smoothly instead of switching instantly.
Why not one long transition of 1800 seconds? You can try it, and it is simpler to write. In practice bulbs and integrations differ in how long a single fade they accept, and some ignore the value, so the stepped loop is the version most likely to behave the same on every light. The while condition is also a useful safety valve: if you switch the light off by hand halfway through, the state is no longer on, the loop ends, and the lamp stays off instead of being switched back on a minute later.
Step 3: Start the script on workdays
Now create the automation that runs the script. First add the Workday integration if you have not already: choose United Kingdom as the country and pick your subdivision, because bank holidays differ between the nations. Holidays come from the underlying holidays library, so check the sensor's attributes the next time a bank holiday approaches to confirm it behaves as you expect.
Create a new automation in YAML mode:
alias: Wake up light on workdays
triggers:
- trigger: time
at: input_datetime.wake_light_start
conditions:
- condition: state
entity_id: binary_sensor.workday_sensor
state: "on"
actions:
- action: script.wake_up_light
Your Workday entity ID depends on the name you gave the entry, so copy the real one from the entity list. The sensor updates at midnight, so the condition is evaluated against the correct day when the trigger fires in the morning. If you want a lie-in on days off with a later ramp, duplicate the automation, change the condition to off, and point it at a second helper, input_datetime.wake_light_start_weekend.
Step 4: Add safeguards so it only runs when it should
A wake-up light that fires when it is not wanted is the quickest way to lose family goodwill. Add these conditions under conditions: as needed:
- Someone is actually home. Add a state condition on your person entity, or on a zone count, so the room does not light up when you are away. The welcome home automation shows presence checks in more detail.
- A holiday switch. Create a toggle helper called Wake light enabled and add a state condition requiring it to be on. A dashboard switch is much easier than editing YAML before a week away.
- The lamp is currently off. Add a state condition on the light so the script does not take over a lamp somebody has already left on.
Keep the automation in mode: single, which is the default, so a second trigger cannot launch a second copy of the script while the first is still ramping.
Step 5: Test the ramp without waiting until morning
Do not wait for 06:30 to find out it works. From the Scripts page, choose Run on the script. Watch the light page in Home Assistant for two or three minutes and confirm the brightness percentage ticks upwards and the colour temperature creeps up with it. If you want to see the whole sequence quickly, temporarily change delay to "00:00:05" and transition to 5, run it, then put both back.
Then test the automation itself. Set the helper to two minutes from now with the Workday condition removed, wait for it to fire, and confirm the script appears in the automation's trace. Restore the condition afterwards. Traces are the fastest way to find out which condition stopped a run, so open the trace first whenever it misbehaves.
Step 6: Turn the light off after you are up
At the end of the ramp the lamp will sit at 100% until you do something. Add a second automation that switches it off when you leave the bedroom, or after a fixed time. A simple, predictable option is a time trigger a couple of hours after the ramp ends that calls light.turn_off on the lamp. If you already use a motion sensor in the room, the motion night light automation pairs well: the same sensor can handle low-level light at night and switch the lamp off in the morning.
At night, the reverse is a goodnight routine that turns everything off at once; see the bedtime routine guide.
Common problems and fixes: why does the light jump to full brightness or never fade?
It jumps straight to bright: the bulb is ignoring the transition. Because the script already steps the brightness every minute, this should only happen if a step is larger than intended, so check that repeat.index * 100 / 30 is still in the template and the loop count is 30.
Nothing happens at all: open the automation trace. The usual causes are a Workday sensor that is off, a condition that references the wrong entity ID, or a helper that has both date and time enabled and therefore fires only once.
The colour never changes: the bulb may be dimmable only. Remove the color_temp_kelvin lines and keep the brightness ramp.
The light stops partway through: something turned it off, which is exactly what the while condition is for. A smart switch, a motion automation or a voice command can all end the ramp, so check the logbook for what changed the state.
The light flickers at the lowest level: some bulbs are unstable at 1%. Raise the starting brightness_pct to 3 or 5 and adjust the step maths to match.
What should you build next?
Once the basic ramp works, you can build on it: add a gentle speaker or a smart alarm clock for people who sleep through light alone (our best smart alarm clock guide has hardware), open smart blinds after the ramp, or start the heating shortly before you wake. All of these hang off the same helper, so changing your wake time stays a single edit.







