Home Assistant now manages OAuth2 application credentials

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

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.

Advertisement

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:

  • Google Calendar
  • Spotify
  • Home Connect
  • Honeywell Lyric
  • Neato Botvac
  • Netatmo
  • Withings
  • Xbox

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.

Advertisement

Table of Contents

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:

Advertisement
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.
The Google Calendar integration in Home Assistant Core 2022.6
A screenshot of the new Google Calendar integration with Home Assistant. It shows the just name (Calendar).
The Google Calendar integration in Home Assistant Core 2022.5

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 allows you to customize a calendar in the graphical interface
The new integration with Google Calendar lists your calendars as entities in Home Assistant
The new integration with Google Calendar lists your calendars as entities

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
Advertisement
Liam Alexander Colman, the author and maintainer of Home Assistant Guides.

About Liam Alexander Colman

Liam Alexander Colman has been using Home Assistant for various projects for quite some time. What started off with a Raspberry Pi quickly became three Raspberry Pis and eventually a full-blown server. I now use Unraid as my operating system, and Home Assistant happily runs in a Docker container. My personal setup includes many Zigbee devices as well as integrations with existing products such as my Android TV box. Read on to find out more on how I got started with Home Assistant.

Leave a comment

Advertisement
Share to...