Can't get attributes from calendar variable in automation

Hi, I have an automation which fetches today’s calendar entries and writes it into a variable I can see in the log the variables but I cannot get to the attributes. Any idea?

Blockquote

  • data:
    message: “Today’s events: {{ family_today }} {{ state_attr(‘family_today’, ‘events’) }}”
    level: warning
    action: system_log.write

I get this:
2026-02-16 12:20:08.503 WARNING (MainThread) [homeassistant.components.system_log.external] Today’s events: {‘calendar.family_online’: {‘events’: [{‘start’: ‘2026-02-16’, ‘end’: ‘2026-02-21’, ‘summary’: ‘Half-Term’}, {‘start’: ‘2026-02-16T04:00:00+00:00’, ‘end’: ‘2026-02-16T05:00:00+00:00’, ‘summary’: ‘Choir’}]}} None

We can’t see it.
Where?

What is family_today?
If family_today is a response variable then it does not have any attributes, it’s an object.
You can look in the documentations for more help, but this is as far as we can help without the automation.

Calendar - Home Assistant

alias: Automation - Get Events For Today
description: ""
triggers:
  - trigger: time
    at: "01:00:00"
conditions: []
actions:
  - target:
      entity_id: calendar.family_online
    data:
      start_date_time: "{{ now().replace(hour=0, minute=0, second=0).isoformat() }}"
      end_date_time: >-
        {{ (now().replace(hour=0, minute=0, second=0) +
        timedelta(days=1)).isoformat() }}
    action: calendar.get_events
    response_variable: family_today
  - data:
      message: "Today's events: {{ family_today }} {{ state_attr('family_today', 'events') }}"
      level: warning
    action: system_log.write
mode: single

even if I try calendar.family_online I cannot get to the event’s attributes. When I use the actions tab in the developer section of home assistant i get also the correct result (not tried to access the attributes for testing there)

This part is nonsense. The state_attr function expects an entity ID as the first argument, you have supplied it with the string “family_today”.

I assume you meant to use the variable family_today, like:

{{ state_attr(family_today, 'events') }}

… but that would still not be an entity ID, it would be the whole response object.


There are a couple ways to get the list of events, the basic option is:

{{ family_today['calendar.family_online'].events }}

That worked to get to this part. So while it looks like an object it’s only a string?

I don’t understand what “it” you are referencing…