How to make time_until formatted message from a calendar event?

Hi,
I try to reach what the title says, but i cant.
My automation is calendar event based, and i would to like to send a notification dynamically.
The message is working, but i coudnt figure out how to format my message as a time until, when my event is.
The summary of the event is working and the start date is also, but if i want to format like this, then i get “None” as a result from the last part of the message.
Something with the synthax but after one year of usage i still dont know, where and when i need to put " or ’ :slightly_smiling_face:
This is the relevant part of the automation:

actions:
  - action: notify.send_message
    metadata: {}
    target:
      entity_id: notify.pixel_10_pro
    data:
      message: >+
        {{ trigger.calendar_event.summary }}
        {{ (time_until(as_datetime(states(trigger.calendar_event.start)))) }}
        múlva!

Thanks in advance!
BR,
Zsolt

The function states() requires an entity ID as the first argument, but trigger.calendar_event.start returns a datetime string.

In this case, states() is actually unneeded since as_datetime can work on that datetime string:

actions:
  - action: notify.send_message
    metadata: {}
    target:
      entity_id: notify.pixel_10_pro
    data:
      message: >+
        {{ trigger.calendar_event.summary }}
        {{ time_until(as_datetime(trigger.calendar_event.start)) }}
        múlva!

{{as_datetime(state_attr(‘calendar.calendarname’, ‘start_time’))|time_until}}

Using the state instead of the values from the trigger variable is not a reliable method since calendars can have multiple concurrent events, but their state and attributes only represent 1 of those events.