Wake-up light alarm with sunrise effect

Does anyone have any experience with lights coming on to maximum brightness at the beginning of the sunrise? I’m also using Adaptive Lighting and wonder if it’s related - the lights (though not always all of them) will turn on bright for a second or a few seconds before going to their expected dim setting.

I’ve already tried adding “pre-sunrise actions” for turning off adaptive lighting sleep mode and setting manual control on.

Its happening for me too. I also tried to disable another Circadian Lights script that I use and the same problem. Are you using tasmota on your lamp too?

Thanks for this blueprint @Sbyx. I modified it to fit my needs but I changed the trigger to use a template and I thought you might find it interesting. I find it really helpful for troubleshooting since it doesn’t run every minute so the trace that failed is very easy to find. Here is the link to my fork but I’ve included the relevant info below.

trigger_variables:
  sensor: !input timestamp_sensor
  sunrise_duration: !input sunrise_duration
  seconds: "{{float(sunrise_duration) * 60}}"
trigger:
  - platform: template
    value_template: "{{  as_timestamp(now()) >= (as_timestamp(states(sensor))- seconds) and as_timestamp(now()) <= as_timestamp(states(sensor)) }}"
1 Like

Ah, interesting, but no I’m not. Mine are Hue bulbs connected to a Hue bridge, which is then set up in Home Assistant.

Does one have a solution to avoid triggering this when taking a nap?

It looks like it won’t work with Govee lights. The light comes on and sets itself to 1% brightness, but after that the blueprint breaks.
The trace only says “Stopped because only a single execution is allowed at September 14, 2023 at 10:27:00 (runtime: 0.00 seconds)”.
I tried it with a Tuya lamp, there it works without problems.
Does anyone have any idea?

When I change the mode from Single to Parallel it keeps running, but the loop goes through without doing anything.

This was happening to me as well. I am using a hue bulb together with adaptive lighting and sunrise effect.

I had to add the following actions to the pre-sunrise and post-sunrise actions.

    pre_sunrise_actions:
      - service: switch.turn_off
        data: {}
        target:
          entity_id: switch.adaptive_lighting_adapt_brightness_bedroom
    post_sunrise_actions:
      - service: switch.turn_on
        data: {}
        target:
          entity_id: switch.adaptive_lighting_adapt_brightness_bedroom
1 Like

I was heading here for the same.

I would like to suggest to use sun elevation for this. So an option in the blue print to obey this or not would be great.

8n the meantime you might want to consider creating a helper wich combines presence and sun elevation.

1 Like

Hi, How could we add an option to define the end_colortemperatur, I have a group with CCW and normal Warmwhite (2700K) bulbs and would like to have the CCW bulbs also just go to max 2700K at the end of the sunrise.

1 Like

After upgrading to Home Assistant Core 10.5, this automation is failing with this in the trace:

Stopped because an error was encountered at October 24, 2023 at 8:47:00 AM (runtime: 0.00 seconds)

In ‘template’ condition: ValueError: Template error: as_timestamp got invalid input ‘unknown 06:00:00’ when rendering template ‘{{0 < as_timestamp(states(sensor) if sensor != ‘none’ else states(‘sensor.date’) ~ ’ ’ ~ manual_time) - as_timestamp(states(‘sensor.date_time_iso’)) <= float(seconds) and states(check_entity) in [‘unknown’, ‘on’, ‘home’]}}’ but no default was specified

1 Like

I have the same issue, just installed the blueprint, thought it was something I was getting wrong! Looks to be a good automation, but I’m new to HA so no idea how to fix it!

1 Like

Exactly same issue. Can someone please help me understand what’s going wrong?
Did the data handed over from sensor(next alarm) change?

Ok, I removed the phone alarm as sensor, to fall back to fixed time, this is what I get then:

In 'template' condition: ValueError: Template error: as_timestamp got invalid input 'unknown 10:40:00' when rendering template '{{0 < as_timestamp(states(sensor) if sensor != 'none' else states('sensor.date') ~ ' ' ~ manual_time) - as_timestamp(states('sensor.date_time_iso')) <= float(seconds) and states(check_entity) in ['unknown', 'on', 'home']}}' but no default was specified

It seems, the as_timestamp broke?

If I understand the error message correctly, it does not know, on which date the alarm is supposed to go off?

1 Like

I tracked down my issue to the Time & Date sensor in my config.yaml. Anyone one who is new to the blueprint, make sure you have it enabled.

1 Like

Any chance to get the lights to full brightness immediately if I turn off the alarm earlier? Sometimes I wake up about 10 minutes before the alarm (yes I am that old :sweat_smile:)

1 Like

I’m seeing the same issue with my dimmer switch. Did you ever figure anything out?

Same thing happens with my Kasa light bulbs

maybe changing ‘mode’ helps.
See Automation Modes - Home Assistant

(this has been mentioned earlier, but with different conditions. see Wake-up light alarm with sunrise effect - #238 by knuella)

CC: @steriku

I had originally done something like this too, but a better solution for me was to set manual control of the lights during the pre-script. This, in my opinion, allows for better control.

I also have an automation that disables manual control on a light after 1 hour. This means that when I turn on the remaining lights in the room they’re already under the control of adaptive lighting so don’t blind you immediately.

Fairly sure that the “Only a single execution” is a red herring. This automation works by running every minute and waiting. This is to ensure it’s always running and waiting for your next alarm. The execution you’re seeing that “has ended because only 1” isn’t the execution that was triggering your alarm.