hemantkamalakar / haconfigs

My Home-Assistant configuration files
60 stars 20 forks source link

Google Fit Component not updating any values #7

Closed polyphia closed 4 years ago

polyphia commented 4 years ago

Installed this component yesterday but sadly it seems to be broken !

Only height and weight get displayed, every other sensor does not update any info after 24h .

Tried checking google console and all the API requests are going through without errors, so the issue seems to be related with the component and Home Assistant integration .

Can you please kindly check ?

Thanks

hemantkamalakar commented 4 years ago

I just checked in home assistant and found that the component is working as it should. Here is a screenshot showing data in Home assistant. Please make sure that you have no errors in the logs and your Google Fit data is synched. image

polyphia commented 4 years ago

Hello !

Thanks for getting back ...

I have a few errors in the logs but they seem to be spread across very different times .

Here's a few of the errors I have detected :


During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/config/custom_components/google_fit/sensor.py", line 415, in update height_datasources = self._get_datasources('com.google.height') File "/config/custom_components/google_fit/sensor.py", line 324, in _get_datasources data = datasources_request.execute()

2019-11-23 16:00:22 WARNING (MainThread) [homeassistant.components.sensor] Updating google_fit sensor took longer than the scheduled update interval 0:00:30

2019-11-23 16:00:35 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.hassiofit_distance is taking over 10 seconds

2019-11-23 16:00:38 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.hassiofit_distance fails

2019-11-23 16:01:29 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.hassiofit_move_time fails

2019-11-23 17:05:22 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.hassiofit_steps fails

2019-11-23 18:08:05 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.hassiofit_calories fails


The calls are effectively being made as I can see per the API Dashboard requests graph and stats :

https://imgur.com/a/AwJB8xV

Since I can see the data on my phone and the calls are being made to the API, seems like the problem has to be on Home Assistant side ?

For the record , I've seen at least 2 other users complaining about the same and similarly only weight and height was displayed for them .

Running on Hassio 0.102

Apologies for not having the errors in a properly formated code block but it doesn't seem to be working .

hemantkamalakar commented 4 years ago

Can you please check if you get the steps using Google Fitness Users.sessions: list endpoint.

polyphia commented 4 years ago

No, my sessions list is empty !

{ "session": [], "deletedSession": [], "nextPageToken": "1574682661xxx" }

hemantkamalakar commented 4 years ago

oh it looks like your Google Fit app is not syncing the data with Google cloud. Can you please check your Google account Sync status. If you are using Android phone try these steps to manually sync your apps. Open your phone’s Settings app. Tap Accounts. If you don't see "Accounts," tap Users & accounts. If you have more than one account on your phone, tap the one you want to sync. Tap Account sync. Tap More And then Sync now.

Refer the link below for detailed steps to sync your apps with Google. https://support.google.com/android/answer/9453724?hl=en

polyphia commented 4 years ago

Thanks so much for your help, I really appreciate it , even more as this is an issue not directly related to your custom component ! I had my auto sync turned off, that's why values were never getting updated in my HA instance .

The only value that does not seem to have any data is sleep, as it only shows the word sleep instead, but maybe that's because this only shows daily values and I still don't have any sleep data for today ?

Also not sure how to get sleep and wake up time, do you need a bayesian sensor for it ?

hemantkamalakar commented 4 years ago

Good that it is working for you. I am using MI band 4 and syncing steps, Sleep and heart rate data from MI fit to Google Fit.