Getting multiple calendar events in one list

Hi,

I’m trying to get a calendar list of all birthdays events of that day from the local calendar in home assistant.
I use the sidebar described in lovelace by matt8707. I got as far as to get a event vissible like this:

Temp

This is done with the following code:

calendar: >
    {% set agenda = state_attr('calendar.birthdays' , 'description') %}
    Birthdays: {{ agenda }}

However this only shows one event. If I have multiple all-day birthday events on a day it only shows one.
How can I fix this?

I read something about calendar.list_events in this topic but I don’t really know how to implement this in the above setting/code.

Thank you all in advance :slight_smile:

BCevin

If you want to get all the events, you must use the calendar.list_events service.

Similar to petro’s example in the thread you linked before you will need to set up a template sensor to retrieve the calendar descriptions:

template:
  - trigger:
      - platform: time
        at: "00:01:00"
    action:
      - service: calendar.list_events
        data:
          duration:
            end_date_time: "{{ today_at('23:59:00') }}"
        target:
          entity_id:
            - calendar.birthdays
        response_variable: birthdays
      - variables:
          events: "{{ birthdays.events }}"
          descriptions: "{{ events | map(attribute='description') | join(', ') }}"
    sensor:
      - name: Today's Birthdays
        unique_id: custom_todays_birthday_events
        state: "{{ descriptions }}"
        attributes:
          birthday_events: "{{ events }}"

Hmm ok, I see what is happening here. I need some help however how to set this up. I’m as green in this as they get. So I’m missing some of the basics I fear and have a difficult time figuring out how to connect it all.
Where do I put these kind of templates. I got the configuration file which has the sidebar.yaml included like this:

template: 
    !include sidebar.yaml

Do I need to do something similar? Like create a separate file with the code like say calendar.yaml and include it in the configuration.yaml file?

PS
If there is some kind of newbie tutorial to how all the files interact with each other I’d love to read it.

Since your sidebar.yaml file is already included under the template integration, you can just copy everything from my example above (omitting the template:) and paste it into that file if you like.

Splitting the config is not generally considered a “newbie” activity… There are a number of, kind of old, Youtube tutorials. Personally, I would recommend using Packages; it is easier to setup for someone less familiar with YAML and more flexible.