Why doesn't this code work

I have the following code for a sensor:

- trigger:
      - platform: time_pattern
        seconds: /10
  action:
      - action: calendar.get_events
        data:
          start_date_time: "2025-10-01 00:00:00"
          end_date_time: "2025-10-31 00:00:00"
        target:
          entity_id: calendar.agenda_bart
        response_variable: agenda_bart_events  
      - variables: 
            all_events: "{{ agenda_bart_events['calendar.agenda_bart'].events }}"
  sensor:
      - name:  Test Kal
        unique_id: Test-Kal
        state: |
            {{all_events|list|count()}}
        attributes:
            all_events: |
                {{all_events}}
        

This results in:


So it doesn’t work.
What’s wrong? I can’t see it anymore.
Thank you for your reply.

You’ve been in the forums for several years, you should know they are english only.

That was a mistake, fixed :unamused:

Still the post title is wrong though :slight_smile:

I think I’m sleeping :sleeping:

Start by going to Developer tools → Actions and seeing (i.e., telling us) what this call returns:

        action: calendar.get_events
        data:
          start_date_time: "2025-10-01 00:00:00"
          end_date_time: "2025-10-31 00:00:00"
        target:
          entity_id: calendar.agenda_bart

Thanks for your reply. It’s been resolved. Apparently, something went wrong with the integration.

Also make sure you add calendar event more that 15 minutes before you espect them to trigger. It’s in the docs…