Problem with creating calendar event

Hi All

I’m trying to add a button to my dashboard to create a calendar entry at a fixed time the following day
I found This Post from last year which seems to be the exact thing im looking for however when I click the button I get an error popping up

Failed to perform the action calendar/create_event. invalid date time specified: {{ today_at(‘06:00’) + timedelta(days= 1) }} for dictionary value @data [start_date_time]

Im using a mushroom template card with a tap action rather than a button but I also tried setting up a button just in case that was the issue but it made no difference

if I copy and paste the templates for the date/times into the template editor they work as expected

tap_action:
  action: perform-action
  perform_action: calendar.create_event
  target:
    entity_id: calendar.battery_charging
  data:
    summary: preheat car
    start_date_time: "{{ today_at('06:00') + timedelta(days= 1) }}"
    end_date_time: "{{ today_at('06:40') + timedelta(days= 1)}}"

Card actions do not support templating, even in cards that support templating for other configuration keys. You need to move the templated logic to a script, then have the card action run the script.

Ahh.
Thanks