Home Assistant now manages OAuth2 application credentials

Disclosure: This post contains affiliate links. If you click through and make a purchase, I will earn a commission, at no additional cost to you. Read my full disclosure here.

Integrating certain services, such as Google Calendar, Spotify, and Xbox has been one of the more daunting tasks for those new to Home Assistant. Many of us are users of these services, and yet they are on the trickier side to set up from scratch. The upcoming release of Home Assistant Core 2022.6 will make this hurdle somewhat easier to jump, by managing OAuth2 application credentials directly from the UI, and by setting up redirect URLs automatically. This article will explain what these changes entail, and why this is a good development for Home Assistant.

The list of YAML-free integrations keeps on growing

Good news for haters of text editors, as this change is yet another step to a YAML-free future, as the configuration.yaml file now remains untouched when integrating the following services with Home Assistant:

It is worth noting that some of the above listed services already supported a YAML-free integration before the release of Home Assistant Core 2022.6. If so, the upcoming changes solely mean that the YAML configuration will be deprecated in a future release of Home Assistant Core.

Do I need to change anything if I'm updating Home Assistant Core?

Fortunately, any existing OAuth2 application credentials in the YAML configuration file will automatically be imported once you hit the update button. As usual, the developers did this with plenty of forethought, as the YAML configuration will be removed in a future Home Assistant release.

How has integrating Google Calendar with Home Assistant got easier?

The upcoming changes to Home Assistant Core unfortunately do not remove the requirement for a Client ID and Client Secret. You must still go through the previous steps to acquire these from the Google Developers Console. The updated integration will remove the need to add the information gathered from the Google Calendar API to the configuration.yaml file. Instead, you add these two pieces of information to appropriate fields when configuring the integration from the dashboard. The following line will subsequently be removed from the YAML configuration:

google:
  client_id: YOUR_CLIENT_ID
  client_secret: YOUR_CLIENT_SECRET

This not only spares you from having to edit the file, but will also make sure that you never accidentally share the Client ID and Client Secret with strangers. All in all, this change is big news for Home Assistant, as it will make the integration of popular services easier and safer.

Other changes to the Google Calendar integration

It isn't just the authentication process that has changes when integrating Google Calendar with Home Assistant. The integration now behaves like other integrations set up in the dashboard, rather than the YAML configuration. Home Assistant now lists your individual calendars as entities, and you can also set the appropriate permission (read and write or read-only) straight from the integrations page, by clicking on the configure button.

A screenshot of the new Google Calendar integration with Home Assistant. It shows the name (Calendar), number of entities, and configuration button.
A screenshot of the new Google Calendar integration with Home Assistant. It shows the just name (Calendar).

What this also allows you to do is easily customize your calendars. From the entities page, you can enable, disable, or hide calendars. Just as with any other entity, you can also use the graphical interface to change a calendars name, entity ID (i.e., calendar.something), icon, and area.

A screenshot showing how a Google Calendar entity can be customized using the graphical interface in Home Assistant.
The new integration with Google Calendar lists your calendars as entities in Home Assistant.

For comparison, the old configuration looked something like this:

- cal_id: "*****@group.calendar.google.com"
  entities:
  - device_id: test_everything
    name: Give me everything
    track: true
A portrait photo oif Liam Alexander Colman, the author, creator, and owner of Home Assistant Guide wearing a suit.

About Liam Alexander Colman

is an experienced Home Assistant user who has been utilizing the platform for a variety of projects over an extended period. His journey began with a Raspberry Pi, which quickly grew to three Raspberry Pis and eventually a full-fledged server. Liam's current operating system of choice is Unraid, with Home Assistant comfortably running in a Docker container.
With a deep understanding of the intricacies of Home Assistant, Liam has an impressive setup, consisting of various Zigbee devices, and seamless integrations with existing products such as his Android TV box. For those interested in learning more about Liam's experience with Home Assistant, he shares his insights on how he first started using the platform and his subsequent journey.

Leave a comment

Share to...