Google Calendar work location

It would be convenient if the Google Calendar integration was able to fetch the “work location” as set in your work calendar. This way, you can automate certain things, e.g. turn on the heating on days that you are working from home, but leave it off when you are working in the office.

This information will soon be made available through the Google Calendar API.

Very interesting idea. How would it make sense to best expose this data? As a separate calendar as an all day event?

Just saw your comment now, sorry about that.

Not sure what would be the best approach here. In Google Calendar, it looks like it’s a specific kind of “event”. That might be a bit much, so a separate calendar might work. Or maybe an all-day event in the calendar that the other items from the synced calendar are put in, just label them with a specific tag in the event title.

Yeah these look like you have to query a particular day: Method: workinglocations.day.read  |  Google Calendar  |  Google Developers – a dedicated calendar with all day events seems like the right approach to me.

It looks like this is only available for workspace accounts. Does that match your expectation? (I have it on my work account, but don’t see it on my personal account)

Yeah, I would use it to fetch my working location from my work calendar. I set that up to let my colleagues know whether I’ll be in the office or WFH. In case of the latter, I want HA to turn on the heating in my home office, so that when the central heating kicks in in the morning, it also heats up my office.

I would benefit from this feature also

But note that working location can also have their own start and end time, they are not always all-day

Also, there are tasks and appointment schedules that are not (yet) shown.

Lastly, Focus time and out of office events are shown, but not marked as such.

So I would suggest adding work locations (and tasks and appointment schedules) as events to the calendar they belong to, but add an attribute indicating the type of event

I’ve got a Google notification about upcoming changes for Google Calendar API v3 which includes also the eventType parameter.

Probably this could help to pull the workingLocation.

Hello Google Developer,

We are writing to inform you about upcoming changes to the Google Calendar API v3 that may impact your applications and notification handling, starting March 11, 2024.

What does this mean for your organization?

The Google Calendar API v3 will now include the eventType parameter to subscribe to specific event types when using Events.Watch. Additionally, starting March 11, 2024, the following changes will be introduced:

  • Default event type filters alignment for both Events.list and Events.watch.
  • Error handling for operations not supported for special event types, such as WorkingLocation, Out of Office, and FocusTime events.

What do you need to do?

To prevent any direct impact in your applications, we strongly encourage you to review your usage of the applications listed below and take the following actions:

  • Events.watch: Specify the event types you need for your application as a parameter to reduce your infrastructure costs. In case you want to request a quota increase, please make sure you have implemented event type filters appropriately. This factor will be considered when we are evaluating quota increase requests.
  • Events.list: Specify the event types you need for your application as a parameter. Without making this change, working location events will start to be returned.
  • Event type: If your code is performing operations on special events, it is important to review it to ensure that your code does not attempt to perform operations not supported for special event types.

We’re here to help

Explore the updated documentation and resources to learn more about Google Calendar API v3:

If you have additional questions, please refer to get help from Google and the developer community.

Thanks for choosing Google Workspace.

It would be great to see the integration support this, until then, I’ve found a way of doing this using the APIs and a REST sensor – Adding Working Location to my Home Automations

@allenporter
Do you see any chance to get the working location exposed, probably by the new capabilities of Google Calendar API v3?
I can confirm that that working location per day is only available for calendars of workspace accounts (Turn working location on or off for users - Google Workspace Admin Help)

Seems totally reasonable to expose as a separate calendar in Home Assistant. While I don’t want to add this myself, I am happy to support a developer who is interested in adding this feature (can guide through the home assistant review process or suggested changes to make it happen quickly).