Hi there, I want to create an automation that runs based on a calendar. I want to turn on the heating 15 minutes before an event in the calendar starts.
To be sure, HomeAssistant knows of the events, I create them via the Calendar of HomeAssistant.
This the the yaml for the above (manually updated the offset to be ISO compabible):
trigger:
- platform: calendar
entity_id: calendar.kriekzaal
event: start
offset: "-00:15:00"
This is how it looks in the automation editor:
This is the yaml after editing via the automation editor (notice the -0:15:0
):
trigger:
- platform: calendar
entity_id: calendar.kriekzaal
event: start
offset: "-0:15:0"
This is the calendar event:
Here I can see that the event is known by HA and that we’re just after the 15 min offset:
Yet, for some reason the automation does not trigger (no trace). Logs don’t show an error. I first noticed the issue in HA 2023.7.1 and after upgrading to 2023.11.3 it still is present. Am I doing something wrong?
I also tried with a template trigger but also that didn’t work.
trigger:
- platform: template
value_template: "{{ 890 < ((as_timestamp(state_attr('calendar.kriekzaal','start_time')) | float() | round(0)) - (as_timestamp(now())| float() | round (0))) < 900 }}"
Other attempt (created via automation editor and copied from yml file on disk):
trigger:
- platform: template
value_template: '{% if (890 < ((as_timestamp(state_attr(''calendar.kriekzaal'',''start_time''))
| float() | round(0)) - (as_timestamp(now())| float() | round (0))) < 900) %}true{%
endif %}'
I created a Github issue but I’m desperately looking for a workaround.