Hey there,
sometimes I’m missing important business meetings just because I’m focused on solving some issue.
Therefore I’d like to get informed by a speaker announcement about my next event.
Sounds simple. All the notification stuff is piece of cake.
However I’m unable to get the next event in a calendar that hasn’t been started yet.
My sensor definition that should count the time until the next event
sensor:
- platform: template
sensors:
calendar_next_event:
friendly_name: Minutes until next event
value_template: >-
{% if states.calendar.mycalendar.attributes.start_time %}
{{((as_timestamp(states.calendar.mycalendar.attributes.start_time) - as_timestamp(now())) / 60) | default(99) | int }}
{%- else -%}
0
{%- endif %}
Is there any way to always access start_time of the next event?states.calendar.mycalendar.attributes.start_time
contains the start time of the running event which fails my logic when two events happen back to back as it will never list 5 minutes until next event but always like -35 for an event that is 35 minutes in with 5 to go until next one.
Thanks, Jens