cyberjunky / home-assistant-google_fit

:hearts: This component tracks your Google Fit activities.
MIT License
99 stars 20 forks source link

Authentication code expired, please restart Home-Assistant and try again #12

Closed LuckyTriple7 closed 2 years ago

LuckyTriple7 commented 3 years ago

HASS 2021.07.04

I got permanent the following Error:

Authentication code expired, please restart Home-Assistant and try again

2021-07-23 11:31:04 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform google_fit
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 383, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 588, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 666, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 419, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 460, in _async_write_ha_state
    extra_state_attributes = self.device_state_attributes
  File "/config/custom_components/google_fit/sensor.py", line 247, in device_state_attributes
    return self._attributes
AttributeError: 'GoogleFitWeightSensor' object has no attribute '_attributes'

Client ID and Client Secret is correct and working with the Google Calendar Integration. Google Fitness API is also enabled.

JonathanTreffler commented 3 years ago

I have the same issue !

boyphongsakorn commented 3 years ago

I have the same issue !

tripplehelix commented 3 years ago

Me too, is this an issue on the integrations side?

sethakeawmok commented 3 years ago

I have the same issue ! and i cut SCOPES = ['https://www.googleapis.com/auth/fitness.body.read', 'https://www.googleapis.com/auth/fitness.body.write', 'https://www.googleapis.com/auth/fitness.activity.read', 'https://www.googleapis.com/auth/fitness.location.read']

after it work but not show heartrate and token use 1 hour not update
wjbeckett commented 3 years ago

Same issue here.

andreasbuff commented 3 years ago

same here

wjbeckett commented 3 years ago

Set your HA timezone to Etc/UTC then restart HA. You'll get a notification to Authenticate. Once the Auth with Google is complete, you can change your timezone back and restart.

Speaking-stone commented 3 years ago

It worked, thanks

bbcorp commented 3 years ago

I confirm, it worked like a charm :+1:

tripplehelix commented 3 years ago

Set your HA timezone to Etc/UTC then restart HA. You'll get a notification to Authenticate. Once the Auth with Google is complete, you can change your timezone back and restart.

Many thanks! This works!

Mio3000 commented 2 years ago

The sensors working on GMT , but when i change the tíme zone back, they stop to update itself… any workarounds pls?

cyberjunky commented 2 years ago

Stale issue, closing, please update to latest version and (re)open ticket if needed.