Get and display next calendar item?

Hi There, In our local calendar we have events of our garbage collection, which alternate weekly between rubbish and recycling. What I would like todo is display what the next one is on my dashboard. e.g.:

Next Garbage Collection: Recycling
or
Next Garbage Collection: Rubbish and Greenwaste

Cheers

Currently it seems that you can only use one event type per calendar. If that right you need two calendars. Compare the Start Time attribute to determine which calendar has the soonest scheduled date.

Here’s a Trigger-based Template Sensor to get you started.

template:
  - trigger:
      - platform: time
        at: '00:00:00'
      - platform: event
        event_type: event_template_reloaded
    action:
      - service: calendar.list_events
        target:
          entity_id: calendar.garbage
        data:
          duration:
            days: 7
        response_variable: garbage
    sensor:
      - name: Next Garbage 
        unique_id: next_garbage_collection
        state: >
          {{ garbage.events[0].summary if garbage.events | count > 0 else 'unknown' }}
2 Likes