Wake-up light alarm with sunrise effect

I set this up yesterday and hopes it would simplify what i was wanting, but I too ran into the same error that hmax got, and frankly i’m a bit lost as well.

@Sbyx: Do you have an idea? Cheers

I’ve been scratching my head on this for the last week and can’t figure it out. The trace has this error:

Stopped because an error was encountered at July 8, 2021, 7:51:51 PM (runtime: 0.03 seconds)

In ‘template’ condition: TypeError: unsupported operand type(s) for -: ‘float’ and ‘NoneType’

at this bit in the code:

image

but I can’t see where the type error is coming from (I think something is getting passed as ‘null’ but I’m not familiar enough with YAML for it tojump out just yet)…

Anyone have ideas? (@Sbyx ?)

1 Like

I’m having the same problem. Any updates around this?

Found the issue. I already had something with the ID sensor.date. After deleting it, it then worked

I went looking for an additional sensor.date, couldn’t find one. Previously I’d cleaned up automations.yaml to get rid of duplicates (which can also cause funky problems), but still no go. Completely removed the blueprint and readded it with no change. :frowning: Disabled what I believe was the last integration I added (Environment Canada) and now it seems to be running (well, it isn’t erroring out anymore at least…). Time will tell whether it works now.

Note that prior to disabling/removing Environment Canada I did delete the “date” line in configuration.yaml:

sensor:
  - platform: time_date
    display_options:
      - 'time'
      - 'date'
      - 'date_time_iso'
      - 'time_date'
      - 'time_utc'
      - 'beat'

and the blueprint didn’t complain, but it still errored out at the same point so that would imply that that wasn’t necessarily the problem.

Weird overall, but we’ll see what the morning brings…

I am also having the same problem. I checked and couldn’t find a sensor.date in my system. I did also not add any other integration prior to this blueprint which could cause the issue. Someone else with an idea? For testing purposes I used a fixed time instead of any time sensor. “In production mode” I will use the sensor from my phone. Here is my code:

alias: Wake-up light alarm with sunrise effect
description: ''
use_blueprint:
  path: sbyx/wake-up-light-alarm-with-sunrise-effect.yaml
  input:
    light_entity: light.tint_rgb_1
    sunrise_duration: 10
    post_sunrise_actions: []
    start_brightness: 10
    manual_time: '22:02:00'

You did add the sensor.date and sensor.datetime_iso (or whatever that one is called) as noted in the blueprint documentation/instructions, correct? Have you ever had it working? If so, try backing out changes made around the time you noticed it not working. As noted above, the Environment Canada one was the one blocking this one from working - reason unknown, but I suspect it created a sensor.date (or similar) internally that conflicted with the one that this blueprint was using but that’s just a wild guess. If this is new and you haven’t had it working ever, try disabling integrations and restarting the system until it starts working.

Yes, I added the mentioned sensor. And what should I say: another day and the automation works :roll_eyes:. I didn’t change anything …

Whatever you do, don’t question it working.

Just smile and quietly switch to another tab in your browser… :wink:

1 Like

I’m in the same error. Brand new to HA and don’t yet have understanding of how to troubleshoot these details. A lifetime ago, I could navigate around in Unix but that knowledge base is somewhere else now. I’m studying hard to figure these things out.

Logger: homeassistant.components.automation.wake_up_light_alarm_with_sunrise_effect
Source: components/automation/init.py:517
Integration: Automation (documentation, issues)
First occurred: July 21, 2021, 11:24:00 PM (749 occurrences)
Last logged: 11:51:00 AM

Error while executing automation automation.wake_up_light_alarm_with_sunrise_effect: In ‘template’ condition: TypeError: unsupported operand type(s) for -: ‘NoneType’ and ‘NoneType’

You need to add the date/time sensor to your configuration.yaml file:

sensor:
  - platform: time_date
    display_options:
      - 'time'
      - 'date'
      - 'date_time'
      - 'date_time_utc'
      - 'date_time_iso'
      - 'time_date'
      - 'time_utc'
      - 'beat'
1 Like

Just installed the blueprint and keep getting this error. Any suggestions?

“Stopped because only a single execution is allowed.”

Hey, I have a problem with the “Alarm Timestamp Sensor” item.
It doesn’t matter what I try, it just doesn’t work.

I have created an input_datetime.justin_aufstehen_schule

I have created a template in my sensors.yaml.

- platform: template
  sensors:
    justin_aufstehen_schule:
      entity_id:
        - input_datetime.justin_aufstehen_schule    
      friendly_name: 'Justin Aufwachen Alarm'
      icon_template: mdi:alarm
      device_class: timestamp
      value_template: >
        {{ state_attr('input_datetime.justin_aufstehen_schule', 'timestamp') }}
##        {{ states('input_datetime.justin_aufstehen_schule') }}
##        {{ as_timestamp(states('input_datetime.justin_aufstehen_schule')) }}

The time that I set in the input_datetime is also returned via the developer console.
but no matter what I enter in the “alarm timestamp sensor” it does not work. neither with sensor.justin_aufstehen_schule nor with input_datetime.justin_aufstehen_schule
it just doesn’t trigger


i have found the solution =) Wake-up light alarm with sunrise effect - #105 by Sbyx
{{states('sensor.date')~' '~states('input_datetime.justin_aufstehen_schule')}}


what might be interesting if there is a possibility to let your script run again?
I have set up an actionable notification.
If you want to “go back to sleep” for a moment, your script should trigger again after 5 minutes. But for that I surely have to bypass the alarm_timestamp_modus somehow?
Or does that make no sense here, and it would be better to start an “increase often light brightness” automation?

- service: light.turn_on
  entity_id: light.light_name
  data_template:
    brightness: '{{states.light.light_name.attributes.brightness + 10}}'

“Stopped because only a single execution is allowed.”

i get the same error

I was never able to get this working.
I setup a new hass.io, added a shelly duo, the needed date sensors, a time input, a template sensor which outputs f.e. 2021-08-29 14:35:00 and the blueprint.
I created an automation using the duo and the datetime sensor and set the sunrise time to 5 mins for testing.
I very often reload things or restartet homeassistant.
Seems like something dont get the awaitet result in a template causing it to not end and therefore not run on the time it should start (in this case 14:45, alarm set to 14:50).

But i am not really sure, what to expect…
Please, can someone help with this?




Hi there!
I know i’ts already been asked, but is there a way to prevent the automation to trigger when you hit snooze? I am already using the “Additional entity to check before sunrise is triggered” option to track if my phone is at home so I won’t wake up my better half if I’m not home.

Hey everyone. Any idea why my might might be dimming before each increase in brightness? It’s light it goes back to the lowest percentage each time, then increases up level in brightness.

I’m using tp-link kasa light switch with regular dimmer bulbs.

I tried implementing this last week. It didn’t quite work for me but all I did was input a manual alarm time and choose a couple of light entities. I checked the history log and this “script” was running every minute which to me seemed very odd. Is there anyway to only trigger this to start running when the current time is wake up time minus the duration of the script…?

1 Like

Hi everyone I got this running and am happy with it. My only question is does anyone have a set of instructions for getting a lovelace card set up to input the time that way?

1 Like