Wake-up light alarm with sunrise effect

Same here, I am also confused. The help says it needs a “Sensor with timestamp of next alarm with device_class: timestamp”. I tried a template sensor that returns datetime as well as isoformat.

{% set alarm_time = state_attr('sensor.pixel_5_next_alarm', 'Time in Milliseconds') / 1000 %}
{% set alarm_time_dt = as_datetime(alarm_time)| as_local %} 
{{alarm_time_dt is datetime}}
{{alarm_time_dt}} # also alarm_time_dt.isoformat()

Both options raising the error

Error: In ‘template’ condition: ValueError: Template error: as_timestamp got invalid input ‘unknown’ 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

The helper in all cases show a valid value, unsure why it’s unknown to the blueprint.

Any help is welcome!

1 Like