#Possibly isolated issue with `calendar.get_events`

1 messages · Page 1 of 1 (latest)

teal maple
#

I've got a template sensor in YAML that worked perfectly for 48 hours. Then, without any changes, it stopped working. No errors were in logfiles, from what I could see.

After much testing, I found that any call to calendar.get_events in the Developer Tools is returning this error:

Failed to perform the action calendar.get_events. Script does not support 'response_variable' for service 'response_variable' which does not support response data.. Got {'type': 'execute_script', 'sequence': [{'action': 'calendar.get_events', 'data': {'duration': {'hours': 24, 'minutes': 0, 'seconds': 0}}, 'target': {'entity_id': ['calendar.emilie_leckiekershaw_com']}, 'response_variable': 'service_result'}, {'stop': 'done', 'response_variable': 'service_result'}], 'id': 55}

Here's the template sensor, also:

template:
    - trigger:
        - platform: homeassistant
          event: start
        - platform: event
          event_type: event_template_reloaded
        - platform: state
          entity_id: calendar.mycalendar
        - platform: time_pattern
          # Matches every hour at 5 minutes past whole
          minutes: 5
      action:
        - service: calendar.get_events
          target:
            entity_id: calendar.mycalendar
          data:
            start_date_time: "{{ now().strftime('%Y-%m-%d 00:00:00') }}"
            end_date_time: "{{ (now() + timedelta(days=1)).strftime('%Y-%m-%d 00:00:00') }}"
          response_variable: agenda
        - variables:
            events: "{{ agenda['calendar.mycalendar']['events'] }}"
            
      sensor:
        - name: "Events Today - MyCalendar"
          unique_id: upcoming_events_mycalendar
          icon: mdi:calendar-star
          state: "{{ events | count }}"
          attributes:
            events: "{{ events }}"
            #summaries: "{{ events|map(attribute='summary')|list }}"
            summaries_list: "{{ events|map(attribute='summary')|list|join('|') }}"

Any ideas? I'm all out!