[SOLVED] Seems impossible to make a daily notification

alias: New automation
description: ""
trigger:
  - platform: time
    at: "00:00:00"
condition: []
action:
  - service: calendar.get_events
    metadata: {}
    data:
      start_date_time: "{{ now().strftime('%Y-%m-%d 00:00:00') }}"
      end_date_time: "{{ (now() + timedelta(days=1)).strftime('%Y-%m-%d 23:59:59') }}"
    target:
      entity_id: calendar.garbage
    response_variable: events
  - service: notify.notify
    metadata: {}
    data:
      title: GAAAAAAAAAAAAAAAA
      data:
        message: |
          ciao  {% for entity in events %}
            - {{ entity.attributes.summary }}\n
          {% endfor %}
mode: single

Hi folks, i am trying to make an automation that sends a notification with the list of all the events for the next day and i have been sitting here for hours trying to do it and this is the closest i got to it all the help is apricieted.

You need to specify the calendar in your template since the response variable events returns a complex object.

  - service: notify.notify
    metadata: {}
    data:
      title: GAAAAAAAAAAAAAAAA
      message: |
        ciao  {% for entity in events['calendar.garbage'].events %}
          - {{ entity.summary }}\n
        {% endfor %}

FWIW, it is not advisable to use notify.notify if you have more than 1 notifier, since the results may be unpredictable.

EDIT: Removed extra data key .

Thanks for the reply but unfortunally like before i don-t even recive the notificatrion and since the variable is defined in a different action i can-t test it to look at errors

i found out that in the log book i can see the error and it is returning this:

You had an extra data key in your original that I failed to remove. I have corrected it above.

After a While of banging my head against the wall i manages to make it work, you just need a help TextBox somowere and a script like the following:

Automation.yaml:

alias: New automation
description: ""
trigger:
  - platform: time
    at: "18:00:00"
condition: []
action:
  - action: script.1712084337964
    metadata: {}
    data: {}
  - delay:
      hours: 0
      minutes: 0
      seconds: 2
      milliseconds: 0
  - action: notify.notify
    data:
      title: Raccolta Spazzatura Domani
      message: |
        {{states('input_text.giovanni')}}
mode: single

Script.yaml:

alias: get calendar events and notify
sequence:
  - action: input_text.set_value
    metadata: {}
    data:
      value: "  "
    target:
      entity_id: input_text.giovanni
  - action: calendar.get_events
    data:
      start_date_time: "{{ (now() + timedelta(days=1)).strftime('%Y-%m-%d 00:00:59') }}"
      end_date_time: "{{ (now() + timedelta(days=1)).strftime('%Y-%m-%d 23:59:59') }}"
    target:
      entity_id: calendar.garbage
    response_variable: eventss
  - action: input_text.set_value
    target:
      entity_id: input_text.giovanni
    data:
      value: |
        {% for entity in eventss['calendar.garbage'].events %}
          - {{entity.summary}}{{- '\n' -}}
        {% endfor %}

TextBox:

input_text.giovanni