I would like to extract time from an calendar timestamp. I have read - I guess - all topics regarding this problem but didn’t find a working solution.
Entering following command under Developer Tools - Template gives a valid time like 18:00
{{ as_timestamp(strptime(state_attr('calendar.lokaler_kalender', 'start_time'), '%Y-%m-%d %H:%M:%S')) | timestamp_custom("%H:%M") }}
In an automation I get this error
Error rendering data template: ValueError: Template error: strptime got invalid input ‘None’ when rendering template ‘{{ trigger.calendar_event.summary }} um {{ as_timestamp(strptime(state_attr(‘trigger.calendar_event’, ‘start_time’),’%Y-%m-%d %H:%M:%S’)) | timestamp_custom(“%-H:%M”) }}’ but no default was specified
I tried several times to insert a default but I didn’t get any valid solution.