Google Calendar "all day" events turn off at ~5PM PDT/midnight GMT (I live in PDT/California)

I use Google calendars to do all sorts of automation (greetings, outdoor lighting, etc) in Home Assistant but I’m running into an issue that despite the start/end times looking correct the calendars/events turn “off” at 5PM (midnight GMT).

I confirmed my server has “time_zone: America/Los_Angeles” in configuration.yaml and the Google Calendars in question are set to GMT -7 (Pacific).

Sunset is now ~8PM so when my outdoor lights go on and check if they should be a special color the event has already ended because it’s after 5PM when the calendars go “off”. Has anyone else run into/resolved this?

Edit: Added Screenshots

HA calendar last night ending at 5:05 PM for all day event & showing today’s “all day” event



time_zone is configured correctly

Google Calendar has correct (PDT) timezone setting.

I think I found why this is happening: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/google/calendar.py#L115
params['timeMin'] = dt.now().isoformat('T')

DT util is defaulting to UTC: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/util/dt.py#L58
DEFAULT_TIME_ZONE = pytz.utc # type: dt.tzinfo

return dt.datetime.now(time_zone or DEFAULT_TIME_ZONE)

At 5:05PM PDT it seems like HA is querying for events starting at 12:05AM GMT which seems like it may not include all day events in the user’s time zone (previous day). Can this issue be resolved by adding the default timezone to params['timeMin'] = dt.now().isoformat('T') call in https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/google/calendar.py#L115 so the call to Google Calendar is using the user’s localized date instead of UTC?

Filed a bug: https://github.com/home-assistant/home-assistant/issues/23720

Sorry to bump an old thread, but what was the solution to this? I’m dealing with the exact same issue and is driving me nuts.

My all day events are turning on at midnight local time, but off shortly after midnight UTC. My history looks exactly like yours too

No action from me was required to resolve this. Things magically resolved on their own eventually – I wasn’t sure if it was an API change on the Google calendar side or something changing in HA to fix it.

Damn, ok. The search continues. Thanks