I’m getting this error on a clean install that’s been authorized.
2019-09-30 14:47:17 ERROR (MainThread) [homeassistant.components.sensor] google_fit: Error on device update!
...
File "/config/custom_components/google_fit/sensor.py", line 330, in _get_dataset
return self._client.users().dataSources(). \
AttributeError: 'NoneType' object has no attribute 'users'
I’m using the config you mentioned in the post I’m replying to. Where does the ‘name’ field come from is it a local name or does it need to match something in google?
Hi. I installed this component, made token. Sensors appeared in HA, but they are all empty, besides height and weight. So it looks like token is good. But why they didn’t fetch data? Three days pass throw, but sensors still show nulls. Any guess?
Yep. It sounds stupid, but all synchronization between third-party apps and Google fit works locally. Because of closing web interface for Google fit in March synchronization starts with Google fit locally and when Google fit synchronize data with online servers. So you need Google fit been active on your phone, but I just deleted it after making profile. What was my problem. I’m not sure about your situation.
2019-12-12 20:34:36 ERROR (MainThread) [homeassistant.components.sensor] google_fit: Error on device update!
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 292, in _async_add_entity
await entity.async_device_update(warning=False)
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 450, in async_device_update
await self.hass.async_add_executor_job(self.update)
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/src/homeassistant/homeassistant/util/init.py”, line 240, in wrapper
result = method(*args, **kwargs)
File “/usr/src/homeassistant/homeassistant/util/init.py”, line 240, in wrapper
result = method(*args, **kwargs)
File “/config/custom_components/google_fit/sensor.py”, line 443, in update
last_time_update = time_updates[0]
IndexError: list index out of range
Is there any way to change the measurement units from metric to imperial for us ‘freedom unit’ impaired folks? I’m sure it could be done with templates, but it seems like the sensor should use the HA unit_system setting.
2020-04-18 19:26:52 ERROR (MainThread) [homeassistant.components.sensor] google_fit: Error on device update!
Traceback (most recent call last):
File "C:\Python38\lib\site-packages\homeassistant\helpers\entity_platform.py", line 312, in _async_add_entity
await entity.async_device_update(warning=False)
File "C:\Python38\lib\site-packages\homeassistant\helpers\entity.py", line 476, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "C:\Python38\lib\concurrent\futures\thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "C:\Python38\lib\site-packages\homeassistant\util\__init__.py", line 240, in wrapper
result = method(*args, **kwargs)
File "C:\Python38\lib\site-packages\homeassistant\util\__init__.py", line 240, in wrapper
result = method(*args, **kwargs)
File "C:\Users\stefa\AppData\Roaming\.homeassistant\custom_components\google_fit\sensor.py", line 396, in update
height_datasources = self._get_datasources('com.google.height')
File "C:\Users\stefa\AppData\Roaming\.homeassistant\custom_components\google_fit\sensor.py", line 303, in _get_datasources
datasources_request = self._client.users().dataSources().list(
AttributeError: 'NoneType' object has no attribute 'users'
I tried to remove the pycache and restart, but the error is still the same…
This works great, I’m digging it a lot! Hopefully this post helps anyone facing syncing issues… I use Fitbit and ended up needing to utilize a third party app to push my data over to Google Fit called FitToFit. Worked wonders syncing everything nice and easy, although I’m sure google will eventually make the sync more streamlined if they ever close on the Fitbit acquisition… FittoFit worked as an interim solution for me.
Disclaimer: I’m a total novice at this but if I can do it anyone can, hopefully the config can keep inspiring others as you have inspired me!