Getting your Android & iOS fitness data into HA

It’s always bothered me that fitness data is siloed in various apps and platforms and from what I’ve seen there is no automated self-hosted solution for such data.

Thus, when you change hardware, app or mobile platform, all your history goes down the tubes unless the platform you’re going to has some bilateral agreement with your current platform and, even then, it’s likely that not all sensors/data types are supported.

Thus, HA to the rescue!

With HA, InfluxDB & Grafana, your fitness history can live forever, as even if you change a platform you can just rename the new entities that get created, thus ensuring continuity in the graphs.

Here’s what I did for Android, I’ll keep it short for now and expand it as requested or as new hardware/software solutions become available:

  1. If you don’t want to go down the custom component route, there seem to be only 2 integrations that provide consistent fitness data in HA: Withings & Fitbit. Thus, the hardware that you use should either come from them, or have data importable in their apps (Health Mate & Fitbit, respectively).

  2. Although Withings wearable devices can monitor steps, the Withings integration doesn’t have this (a feature request for the HA integration exists, as the API does seem to expose steps), so for now Fitbit seems to be the only (native) game in town for getting your daily step count automatically imported.

  3. Withings you can setup simply via the native integration and will provide many data points, depending on your hardware:

  • the scales provide weight, bone mass, fat mass & ratio, muscle mass & pulse wave velocity
  • the thermometer provides body temperature, skin temperature & ambient temperature when the reading was taken
  • the blood pressure monitor provides diastolic blood pressure, heart bpm (but obviously only at the time of the reading) & (I think) SP02 (also only at the time of the reading)
  • the under-mattress sleep analyzer provides a whole bunch of sleep data, too many sensors to list (will update this when I eventually get one)
  1. Fitbit provides the data listed in Fitbit - Home Assistant (home-assistant.io)

  2. A very important element is the Health Sync - Apps on Google Play app (free to try for a week, 3 EUR for a lifetime license), which can send data from pretty much any major fitness ecosystem like Google Fit, Samsung Health, etc. into Fitbit. This resolves the issue of steps & distance (as well as sleep & weight data if not using Withings hardware), but unfortunately lacks the option of importing heart rate data into Fitbit. Apparently, Fitbit doesn’t allow either import or export of heart rate data from their app, so if you want constant heart rate data from Android natively in HA, the only way to go is to buy a Fitbit wearable with a heart rate tracker.

  3. Together, Withings & Fitbit can provide all the above-mentioned stuff to HA, which can then be added into InfluxDB & Grafana. How to setup InfluxDB & Grafana is outside the scope of this guide, but you can just use the generic instructions for installing them and simply select the entities exposed by the Withings & Fitbit integrations in order to get your graph on :slight_smile:

For iOS Apple Watch data there seem to be 2 options:

  1. At step 5 above, connect the Apple Watch data to Strava and then Strava to Fitbit (free)
  2. Use Health Auto Export - JSON+CSV on the App Store (apple.com) , which apparently hooks into HA and sends the Apple Watch data (not free, still need to test it)

Hope this helps someone else also :slight_smile:

2 Likes

Or buy a Garmin Watch. There is a nice Garmin integration in HACS. :wink:

Yeah, I did see that, but I’ve never been totally satisfied with stuff on HACS, generally there’s a reason it is not yet in HA Core…HACS has something for Google Fit also, but there were some complaints about rapid token expiry and stuff, so I just tried to obtain the best solution I could without resorting to HACS.

What I found surprising is the lack of self-hosted solutions for this purpose, given that the current software landscape is a disaster if you don’t always stick to one of the 2 main mobile platforms or want to change tracker hardware brands.

This is absolutely super! I tried out a HACS integration for Google Fit about a year back, but that soonly stopped working after having issues with the API scope and token expiry. Unlike the HACS alternatives (not practical alternatives really), the Fitbit integration was up and running in minutes. Thanks for making this post. :grin:

1 Like

Glad to have been of assistance! It’s still not a solution I’m fully satisfied with, so I might just end up buying a Fitbit device to finally have that heart rate data, especially now that my Wear OS watch’s battery lasts 8 hours :stuck_out_tongue:

I will still go for a Garmin, especially, when battery life is important :wink:

Great solution! However i dont get the steps from samsung to fitbit using the sync app… The calories etc work but not the steps…

Maybe Fitbit changed their API to not accept this…does it still show up in the Health Sync app as an option but not work, or is the option for steps itself gone?

I’ve gone the Apple Watch route in the meantime and use the Health Auto Export app mentioned in the OP, it works reasonably enough…

I just spend A LOT of time to get the Fitbit integration to (mostly) work, seeing that one of the monitored resources is “activities/heart” but I can only get the Resting Heart Rate, NOT the current heart rate. This is very annoying!
I want lights to flash, alarms to blare if current heart rate is outside preset limits.
It’s NOT ENOUGH that my watch/phone app would start vibrating or such; I want to be able to set my own “notifications” and Home Assistant would allow that.
Is there any solution to this?

If have no direct solution for you and only for iOS. If you are sync your data to Apple Health you can use Health Auto Export to automatically sync that data to Home Assistant.

I‘ve shown this in the linked video but its in german. But i got the feedback that it is good follow with the automatic youtube translation.

1 Like

Thank you smartmatic but I’m an Android user.
I did have an iPhone once and while I can’t say it was all bad, It’s not likely I’ll go back to that ecosystem.
I found I can get to my Wear Os Heart Rate directly, but I’m not sure yet how fast/reliable updates are.
Anyway, it’s something until a wearable ESPHome or other solution comes up… if ever.
HeartRateChart