Google calendar get more than one event

Hi,

I try to get info of a thrash calendar on google. I have configer and see the next event on the entity. But on some days ther are two events on the same day and time. How I get both events?

I try to config the sam calendar with different names and different search terms on the google_calendars.yaml but then I only saw the last one.

Thank you, Steffen

I think you may be out of luck trying to get it to work the way you want. The only way I’ve found to see simultaneous events in the same google calendar is to define separate calendar entities with that target the same google calendar but with various search parameters, so they show up with different results.

Thank you, not very comfortable, but it is working:

- cal_id: [email protected]
  entities:
    - device_id: elw_abfallkalender
      ignore_availability: true
      name: ELW-Abfallkalender
      track: true
    - device_id: elw_abfallkalender_bioabfall
      ignore_availability: true
      name: ELW-Bioabfall
      track: true
      search: "Bioabfall"
    - device_id: elw_abfallkalender_restabfall
      ignore_availability: true
      name: ELW-Restabfall
      track: true
      search: "Restabfall"
    - device_id: elw_abfallkalender_altpapier
      ignore_availability: true
      name: ELW-Altpapier
      track: true
      search: "Altpapier"
    - device_id: elw_abfallkalender_wertstoffe
      ignore_availability: true
      name: ELW-Wertstoffe
      track: true
      search: "Wertstoffe"

Steffen

Hi,

Today I tried to add a second event to my automation, but it doens’t work for me.
This way my config in google_calandars.yaml works fine:

- cal_id: [email protected]
  entities:
  - device_id: home_assistant
    ignore_availability: true
    name: Home-Assistant
    track: true
  - device_id: test_wekker
    ignore_availability: true
    name: Wekker vroeg
    track: true
    search: "#Wekker vroeg"

But when I’ll add the following below search: “#Wekker vroeg” It isn’t working anymore:

 - device_id: test_wekker_laat
    ignore_availability: true
    name: Wekker laat
    track: true
    search: "#Wekker laat"

Can somebody help me out on this issue?

Thanks.

Just to chime in here, I have exactly the same:

  1. HA is too “dumb” to see overlapping events, and garbage collection is usually tagged as an “all_day” event.
  2. (Not HA’s fault): Google calender is actually too dumb to search for anything else than a whole word, i.e. I can’t search for “müll” (which is part of the words “Restmüll” and “Problemmüll” I’m looking for). Verified that on the Google Calandar online.

So currently the only way is really to
a) set up an extra garbage calender in Google (so it won’t overlap events with your main calendar), and
b) split that up into separate entities for each kind of garbage.

Extremely unusable … you end up with lots of (theoretically) unneded scripts and automations, especially if you want to “warn ahead” like I do, i.e. make alarms on the day before the event (so not to forget putting the rubbish bin out) and while the event is still going on (“Did you haul the rubbish bin in yet?”).

I even tried to set up templated conditions but these don’t work, because at midnight it switches from “Restabfall” to “Biomüll” so I can’t see the “Biomüll” event the day before … sigh.

I really wonder what the max_results parameter is for. The Google Calendar integration most certainly needs some overhaul!

The overlapping events thing really needs work. I have my google home devices play a reminder for certain events in my kids’ calendars, but if either of them have second event that starts before the first one finishes, then the second one is totally ignored.

Seems like every calendar could have two sensors. One to tell you that events (yes, plural) are currently happening, and another to tell you that events are upcoming (via a configurable amount of time in advance). Maybe still a third sensor for all-day events. Having a single calendar entity is very limiting.

I wonder if an array or list value for the state of an entity could be a thing…

… or at least an attribute containing an ordered dict or list …

1 Like

I have the same problem. I want to check {{ state_attr('calendar.contacts', "message") }} to alert me of peoples’ birthdays. It only shows one event in the message, which is a problem when multiple events occur on the same day.

atomic-calendar-revive has support for multi-day and all day events. Perhaps @marksie1988 has some insights into how we can solve this.

There is still no solution?

No Solution in a pure HA way, but maybe someone is interested in my Appdaemon “solution” (python).
I use an app that looks for birthdays in my google calendar, and more of them can be the same day. The Appdaemon app creates HA entities then. This is neither an efficient nor a very nice way, but it works for me. You see the result in the card “Geburtstage”.


3 Likes

@der-optimist This is a great solution! Thank you very much for the help!