I have used to have a template to start an automation 15 min before the event ends. This do not work anymore. I know there was a breaking change on this in 2021…
TypeError: unsupported operand type(s) for -: ‘NoneType’ and ‘float’
And in the log file i get:
WARNING (MainThread) [homeassistant.helpers.template] Template warning: ‘as_timestamp’ got invalid input ‘’ when rendering template ‘{{ ((as_timestamp(states.calendar.MY_CALENDAR.attributes.end_time) - as_timestamp(now())) < 900) }}’ but no default was specified. Currently ‘as_timestamp’ will return ‘None’, however this template will fail to render in Home Assistant core 2022.1
Those messages are likely because there is no calendar entry for “MY_CALENDAR”.
if the calendar entry doesn’t exist then there is no “end_time” attribute so the template doesn’t render properly.
you can get rid of the warning by supplying a default for the “as_timestamp” conversion (see here for how to do that) but if the calendar entry doesn’t exist then you still won’t get a valid trigger since it will always default to the default value.
I think you need to see why you aren’t getting the calendar entry to populate first and go on from there.