Switching users for google calendar

When the google calendar was added a bit ago. I futzed around with the calendar and got it working with my normal gmail account. It was working fine for a bit then it stopped working but I had no triggers set up for it so I sort of ignored it and commented out the google section.

Recently I wanted to do the integration again but this time set it up with my G Suite calendar. So I went through the process again, delete the orignal app from gmail and created a new one under my G Suite account. Added the new client id/secret to my secret.yaml file, reenabled google in my configuration.yaml. I also changed the cal_id in google_calendars.yaml to point to my G Suite account. But I cannot get the HA UI to prompt me for the activation.

Running: 0.84.6 (docker) Is there anything else I need to delete or switch?

configuration.yaml:
google:
client_id: !secret gcal_clientid
client_secret: !secret gcal_secret
track_new_calendar: true

google-calendars.yaml:
- cal_id: [email protected]
entities:
- device_id: aram
ignore_availability: true
name: Aram Mirzadeh
track: true

here is the relevant log entries:

    2018-12-24 11:25:41 ERROR (MainThread) [homeassistant.helpers.entity] Update for calendar.aram_mirzadeh fails
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/app/homeassistant/helpers/entity.py", line 349, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/app/homeassistant/components/calendar/__init__.py", line 155, in update
    if not self.data or not self.data.update():
  File "/usr/src/app/homeassistant/util/__init__.py", line 324, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/app/homeassistant/components/calendar/google.py", line 113, in update
    result = events.list(**params).execute()
  File "/usr/local/lib/python3.6/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/googleapiclient/http.py", line 837, in execute
    method=str(self.method), body=self.body, headers=self.headers)
  File "/usr/local/lib/python3.6/site-packages/googleapiclient/http.py", line 163, in _retry_request
    resp, content = http.request(uri, method, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/oauth2client/transport.py", line 186, in new_request
    credentials._refresh(orig_request_method)
  File "/usr/local/lib/python3.6/site-packages/oauth2client/client.py", line 756, in _refresh
    self._do_refresh_request(http)
  File "/usr/local/lib/python3.6/site-packages/oauth2client/client.py", line 812, in _do_refresh_request
    raise HttpAccessTokenRefreshError(error_msg, status=resp.status)
oauth2client.client.HttpAccessTokenRefreshError: deleted_client: The OAuth client was deleted.

First off, no expert here but I’ll ask a couple questions that I would do and maybe that will help?

I am assuming your spacing is correct in your configuration file not what I’m seeing in your question.
I wonder if you have a .google.token file left over from the original configuration? Maybe you need to delete this file to get the new authorization?

In the HA directory type l -all, if you have a .google.token file rename it and see if your met with the prompt to complete the new configuration.

2 Likes

That was it, I had missed erasing the .google.token file.
Thank you very much.

Your answer saved me as well. Why in the world the token file is a hidden file is beyond me.

Edit: Yikes… sorry for reopening a very dead thread.