Google Fit integration

Intervals.icu now integrates with Google Fit for wellness data download (tx @Daniel for all the help with this!). Look for this box in /settings:

Screen Shot 2021-07-13 at 20.21.44

Intervals.icu calculates wellness from Google Fit as follows:

  • Sleep time is time spent sleeping less awake and out of bed time
  • Resting HR is the lowest HR recording during sleep (if sleep is enabled) or the lowest HR for the day otherwise
  • Average sleeping HR is what it says
  • Weight is the first reading found on each calendar day
  • Blood pressure is the first reading found on each calendar day
  • SpO2 is the first reading found on each calendar day

The Google Fit API does not supply any timezone information (what were they thinking?!) so all dates and times are assumed to be in your Intervals.icu timezone.

9 Likes

Do I need to apply somehow some way?

You just need to send me the email address of the Google account you want to use for this.

1 Like

Thanks, sent!
I do have an SpO2 measuring watch

I’m currently syncing weight from Strava (which in turn pulls the data from Google Fit).
Will that somehow interfere? Should I disable Strava weight syncing?

They should end up with the same number but probably better to turn of Strava sync.

1 Like

I already mentioned it for the Garmin sync, but it would work for the Google Fit sync as well. Google Fit also stores hydration data: Nutrition data types  |  Google Fit  |  Google Developers. Maybe it would be fun to sync that to intervals as well.

Like most sources it would require a solution for a simple mapping problem. The hydration in the wellness data is a subjective 1-4 scale while most sources would provide a volumetric unit. I see two solutions. Either an additional field where a volumetric measurement could be stored or a mapping in settings where you would define what you would count as Great, Good, OK, or poor hydration.

The same holds for the nutrition data that could be stored in Google fit. This one would be even easier where it would be just the sum of all food items.

I added a new wellness field “Hydration (L)” which syncs from Google Fit. If you are using that you can probably just ignore the subjective hydration field. I haven’t seen any Google Fit data with nutrition or SpO2 yet so those are still outstanding.

Awesome, seems like the right solution.
When trying to enable the field I get the following error however:

Invalid wellness option [hydrationVolume]

This also happens when I disable my cache.

Is that still happening? I may have forgotten to deploy the most recent changes in which case it should be fixed now.

Thanks, it is fixed now. :slight_smile:

Would it be an idea to sync activities to intervals as well. Preferably with a filter on what type as well since you can have quite a bit of walking “activities” during a day.

Cool. It doesn’t look like I can get any activity files from Google Fit and without that there isn’t much I can do with them.

Yeah, it’s not going to give files I think. However it can provide a start/end time and you can request the HR during that session. I can imagine that it would be quite a big task since the different nature in which the data is organised.

The reason I’m mentioning it, is because it can be a good data source for the TSS you can accumulate besides biking from cross training.

Intervals.icu has been approved by Google so Google Fit integration is now available to everyone. It is still quite new so if something isn’t coming through correctly, let me know.

1 Like

Would it be possible to add a button in the integration to import historical data? I have quite a bit of historical data where the avg sleeping and resting heartrate are calculated differently. I don’t really care particularly how they are calculated, but having them be consistent is quite important for evaluation.

If you disconnect and re-connect it should pull in everything since 2015. Is that far back enough? It will take a few minutes.

1 Like

More than far enough :slight_smile:

It works like a charm, thanks!

EDIT: Oh it might not have worked. I tested it incorrectly. I’ll give it a couple of minutes though

Indeed I was to wrong. It does not seem to sync it. I deleted two values, both HR values for 30th jun/ 1st july, to check if that would make a difference, but those were also not filled in.

This time it did not open the Google consent screen. I presume because permission was already given, but that might have something to do with it.

Hmm. I will need to poke around. Supposedly it did the old data search:

Fetching new wellness for athlete i22997 from GOOGLE_FIT start 2015-01-01

My ISP is having hassles getting to Germany right now so I will need to see if its better in the am.

Looks like I have more work to do:

"code": 400,
"message": "aggregate duration too large"
1 Like