Calendar events

I succesfully use the Google Calendar integration, but so far only with whole day events. I have numerous automations using this integration and I use the time offset to adjust for when automation should start.
When I view the calendar in HA it shows all my events for the week (and following weeks) and therefore individual calendar events (business lunch at 1 pm on 5-12-2023) show, but I have not figured out if & how I can use these individual events in an automation, so that no time offset is needed.
An example of automation would be to have Alexa remind me of my schedule.
Does anyone use the time specific events in their Google Calendar in automations ?

If you want Google calendar events available for something like an Alexa notification, the best option I have found is the Hass Calendar Addon.

Thanks. I tried to add but every time I fill in the options (http://homeassistant.local:8123/hassio/addon/6a4ec433_hass_calendar_addon/config) and save, it empties all my choices.
I may not fill in properly : calId: googleCalendarId (only for Google Calendar)
googleServiceAccountKeyfile: yourServiceAccountJsonKeyfile (only for Google Calendar)

Here is how I personnally solved my issues related to calendar events.

I use the Ical integration for more than one Google calendar. You can re-add the integration for each google calendar you have.

I created a macro that searches for an event, on a certain date, in a certain calendar.

{% macro event_ondate(desc_event, date_event, calendar) -%}

    {%- set j = namespace(no=-1, val=false|bool()) -%}

    {%- for i in range(0, 40) -%}
        {%- if state_attr('sensor.ical_' + calendar + '_event_' + (i | string), 'summary') in desc_event and 
        date_event in state_attr('sensor.ical_' + calendar + '_event_' + (i | string), 'start')|string -%}
        {%- set j.no = i -%}
        {%- endif -%}
    {%- endfor -%}
    
    {%- if j.no != -1 -%}
        {%- set j.val = true|bool() -%}
        {%- set heure = state_attr('sensor.ical_' + calendar + '_event_' ~ j.no, 'start').strftime("%H:%M") -%}
        {%- set eve_ondate = {'value': j.val, 'hour': heure}|to_json -%}

    {%- else -%}
        {%- set eve_ondate = {'value': j.val, 'hour': 'None'}|to_json -%}
    {%- endif -%}

    {{ eve_ondate }}

{%- endmacro %}

The output with contain the boolean if the event exist on that date(.value), and if so, at what time(.heure).

Based on this logics I created sensors that will ask questions, like determine if I am working today, if so at what time, and am I working from home or at the office today… (I put it in the calendar when I have to go at the office.)

For example a sensor might use the macro to define the attribute “at office” (boolean) of a sensor, for today’s workday.

Here is a part of a sensor that I use:

binary_sensor: 

  - name: work_today
    state: (some code here...)
    attributes: 
      At office: >
        {% from 'tools.jinja' import event_ondate %}
        {% set wd = event_ondate('Office', now().strftime('%Y-%m-%d'), 'my_calendar_name')|from_json %}
        {{ wd.value }}
      Hour: >
	    {% from 'tools.jinja' import event_ondate %}
        {% set wd = event_ondate('Office', now().strftime('%Y-%m-%d'), 'my_calendar_name')|from_json %}
        {{ wd.hour }}

Note: the last line would have been {{ wd.heure }} if I wanted the attribute to show the hour at which the event starts.

This simplifies my automations since I can set my morning alarm clock using a template trigger, 2 hours before I start to work, in case tomorrow is a workday (I defined 2 similar sensors, one for today, one for tomorrow).

{{ ((strptime(state_attr('binary_sensor.work_today', 'heure'), ('%H:%M')) - timedelta(hours=2))|string)[11:16] }}

I still struggle in manipulating the time formats, so I don’t know if it’s the best way to put it, but I still end up with a code that works.

I installed this and used the URL given in the Google settings, but no event shows. I’ll work on thia tomorrow. Thanks for the suggestion

I tried again and again. There is no error message while setting up the Ical integration, but no calendar data is found in HA. I looked for * sensor.ical_my_calendar_event_0 or * calendar.ical_my_calendar, but nothing.
However when creating a Calendar card, I see the calendar and can be added to that calendar card, but no events show.
Could it be that I already have the Google Calendar Integration running ? I would prefer not to delete that Integration.