Sunrise Light Simulator

Sunrise Light Simulator

A blueprint that gradually brightens your lights and changes their color temperature to simulate a natural sunrise over a customizable duration.

Features

  • :sunrise: Natural sunrise simulation - Gradually transitions from deep red/orange to bright daylight
  • :dart: Flexible targeting - Select individual lights, multiple entities, entire areas, devices, or labels
  • :stopwatch: Customizable duration - Set sunrise length from 10 to 120 minutes
  • :bulb: Adjustable brightness - Set maximum brightness as a percentage (1-100%)
  • :art: Color temperature progression - Smoothly transitions through 2000K → 2200K → 2700K → 3500K → 4500K → 5500K

Configuration

When creating an automation from this blueprint, you’ll configure:

Parameter Required Default Description
Lights Yes - Select lights by entity, area, device, or label
Start Time Yes - Time to start the sunrise (e.g., 06:45:00)
Duration No 45 minutes How long the sunrise should last (10-120 minutes)
Maximum Brightness No 100% Maximum brightness level at the end (1-100%)

Usage Example

  1. Go to Settings → Automations & Scenes → Automations
  2. Click Create Automation → Sunrise Light Simulator
  3. Configure:
    • Lights: Select your bedroom lights or bedroom area
    • Start Time: 06:45:00
    • Duration: 45 minutes
    • Maximum Brightness: 80%
  4. Save the automation

Your lights will now gradually wake you up with a natural sunrise simulation every morning!

How It Works

The blueprint creates a 5-stage sunrise progression:

  1. Stage 1 (0-11%): Deep red/orange (2000K) - Very dim
  2. Stage 2 (11-33%): Warm orange (2200K) - Gentle glow
  3. Stage 3 (33-55%): Warm yellow (2700K) - Soft light
  4. Stage 4 (55-77%): Neutral white (3500K) - Increasing brightness
  5. Stage 5 (77-100%): Cool daylight (4500K → 5500K) - Full brightness

Each stage uses smooth transitions to create a natural, gradual effect.

Requirements

  • Home Assistant 2021.3 or newer
  • Lights that support:
    • Brightness control
    • Color temperature (Kelvin) control

Troubleshooting

Lights don’t support color temperature:

  • The automation will still work for brightness, but color changes may be ignored
  • Consider using RGB lights or lights with tunable white capability

Automation doesn’t trigger:

  • Check that the start time is set correctly
  • Verify the automation is enabled
  • Check Home Assistant logs for errors

Transitions aren’t smooth:

  • Some lights have limitations on transition duration
  • Try adjusting the duration to be longer

Installation

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Option 2: Manual Installation

  1. Copy the blueprint YAML code
  2. In Home Assistant, go to Settings → Automations & Scenes → Blueprints
  3. Click the Import Blueprint button
  4. Paste the URL or YAML content
  5. Click Preview and then Import
5 Likes

You may think about briefly starting cool during the pre-sunrise stage.
The blue hour is the cool colored light that occurs in the twilight before the sun comes up

its been argued that this is also an important part of naturally waking.

3 Likes

@seanharsh: This looks like just what I’ve been searching for! Thank you for writing it.

I’m experimenting using it on v2026.1 and have noticed a log entry that “kelvin” has been replaced with “color_temp_kelvin”. I’ve made the adjustment in the YAML so I’m hoping that fixes it.

Also, I am using two Govee lights that are integrated with Mosquito MQTT and work well. However, there is a classic wall switch that controls dimmable power to them. Before I run your script, how should I set the switch? Do I turn down the Govee lights, but turn the switch on in your script? But that would seem to not provide power to the Govee lights?

I’m sure there’s a simple setup here, but I’m a newbie with HA and I’m not sure what your code needs to succeed.

Ill look at the kelvin option again, might have changed it since I released this.

As to the Govee, MQTT should work fine as long as the bulb has the standard brightness controls. For your standard swtich, I would leave it all the way up, and control brightness via HA itself (If I understand your setup correctly). Smart bulbs should always get 100% power.

Or do you mean the MQTT is pushing a swtich entity for the lights? If so, leave that be and use the light entity of the bulb(s) or group them and use the light group instead.

Thanks for the quick reply!

Yes, this is what I figured - the wall switch needs to be on 100% for the Grovees to get power. Should I set that in the “run this before automation” setting? I’ve tried this and it turns on the Grovee lights which runs the sunrise concept. Maybe I should start with the switch on and the Grovee lights to 1%? I’m still experimenting.

The MQTT is how the Grovee lights are set by HA. HA make the call via MQTT and the Govee lights obeys. This seems to work well and with good response times.

Or maybe I shouldn’t use Grovee lights. I have these on a trial and can return them. Do you recommend another manufacturer?

OK, so you do have a physical switch that controls dimming. What brand is it?

Govee is fine, really anything that runs in MQTT should be great. If you don’t have a zigbee network yet, Govee are great. I run a mix of Govee (for the TV back lights and to sync with other bulbs in the room for entertainment fun) and then some Segland zigbee, Ikea zigbee, and I think a Hue somewhere.

To be honest, I am using this in our bedroom with some older LIFX bulbs, all of which are attached to Innovelli switches. Those switches are set to smart bulb mode which provided constant power, but allows me to program the paddels to control power and brightness.

Maybe try to verify the switch is 100% in “Pre-Sunrise” and maybe see if the bulb(s) will let you set brightness to 0, worst case 1%.

For reference, here is my automation using the bedroom situation I described earlier:

Many thanks for screenshot - that’s helps for sure. Ironically I slept though the “rise” this morning, but I’m going to test it again soon.

I had some luck this morning. The trick settings seem to be in pre-sunrise actions to turn on the Insteon master dimmer to 100% and then set both Grovee bulbs power equals off. It happens so fast that I don’t notice. Then your script runs.

I’ve noticed the script doesn’t change the bulbs as smoothly as I’d like. In looking at your YAML, I see something like this a few times in the code:

- service: light.turn_on                                                                                              
  target: !input target_lights                                                                                        
  data:                                                                                                               
    brightness_pct: '{{ (max_brightness * 0.10) | int }}'                                                             
    color_temp_kelvin: 2000                                                                                           
    transition: '{{ (duration * 60 * 0.185) | int }}'                                                                 
- delay:                                                                                                              
    seconds: '{{ (duration * 60 * 0.185) | int }}' 

While this works, I wonder why you don’t use a loop whose looping steps could be set/controlled? Or is that not possible a HA YAML? I’m an experienced coder, but a total newbie to HA and thus am only beginning to understand HA’s YAML files.

If this is possible, I’m happy to help with a PR if I can find the time.

Here’s the blueprint with some looping fixes. It also supports a Kelvin range.

Unfortunately my Insteon lights just don’t look compatable with the Grovee bulbs. I can’t turn on the power (via the dimmer) to the lights and turn them Govee light off fast enough. There is no Govee setting where the power-up as off or 1%. So, the sunrise gets really bright before it goes back to 1% to start. {sigh}

Yea, I think there was an issue with my LIFX bulbs and using a loop, but they seem to transition between % smoothly themselves, so it was never noticeable. I may try to loop them again using your changes and see what happens. You can also create a pull request on my repo to make the change there if you want to add more.

How best can I apply this new code while waiting for this to be applied to the main branch? Sorry for the noob question, I am new to all of this.

You could save the yaml dump it into your HA instance config “blueprints/automation” if you want to use dstricker’s version.

I am testing his changes locally to see if looping is better, and will incorporate it into my codebase if so.

I have adjusted mine to use a loop, but instead of it being linear, I am using a curve, one to try and mimic the slow and then fast brightness from a typical sunrise.

In example, if you set your max brightness to 100% and duration at 45 minutes, you get something like this:

0 min 1% 2000K
5 min 5% 2400K
15 min 20% 3200K
30 min 55% 4400K
45 min 100% 5500K

I will tell you, I can not get the transition to work smoothly for my Govee bulbs here, either using mqtt or matter. When trying to apply the transition using the light.on action, it ignores the time. And I do get a weird flash at the start of the automation that does not seem to be resolvable pre either. The LIFX bulb does have a transition and was why I was using my 6 step process earlier; it was smooth.

Give the new loop a try. Just re-import the blueprint using my link/button above.

Sorry, I’ve been out of touch and haven’t got a PR ready yet. Sounds like you’ve been updating your code and may just want to pick anything out of mine that’s useful and not have me do a PR at all.

No problem, I looked at yours a little, had time today to re-write the loop, and test a bit. Im sure you have more better ways, and Ill keep an eye out for a PR if you want to send one my way.

Compare with mine, I decided to start from scratch since my research suggested a curve more than a linear approach to the sun’s progression. I did not integrate everything you suggested either.

1 Like

Updated Blueprint

Features/Changes

  1. While loop with more sun-like kelvin curve.
  2. Stop automation if target light is turned off inside the duration. Also skips post actions.
  3. User can adjust step intervals to try and smooth out transitions from one % to the next.

Please submit issues and PRs in the source repository here: https://github.com/seanharsh/Home-Assistant-Blueprints

Thanks everyone!

1 Like

Just started using this and it’s awesome!

The only thing that would be nice is being able to select which day(s) to run, so I don’t get woken up early at weekends

Yea, same as my wife haha. I run an automation based on our location data as well as calendar events and phone alarms to disable this as well as other automations when we are known to not have to be anywhere in the morning. I have been thinking of adding it built-in for those more simple situations.

Ah, how do you disable an automation from running like that? Wouldn’t mind doing it that way since I have a calendar event set up for when I don’t have work as well

Use a condition ( And if ) that allows the automation only when the conditions are met.