Why (and how) I'm building my own health tracking dashboards
How I automated my health tracking using Grafana, InfluxDB, Tasker, and Android's Health Connect - no more manual data entry.
You know that moment you’re switching between your apps or your cobbled-together spreadsheets, trying to see whether you’ve hit your targets? That was me in December.
I was typing out step counts from Samsung Health, body weights from Withings and calorie intake from LoseIt! into a table in Obsidian.md and creating charts of my progress against my targets. While it worked it was very clunky and prone to human error and forgetfulness.
Taking a break over the holidays, I decided to implement a better solution for the new year. A solution that was automated, beautiful to look at, highly visible, and didn’t require that I use the Cloud.
So I built it..
Now I have a single dashboard that automatically tracks my health data and displays it on a screen in my house. It’s not just functional - it looks cool enough that guests actually ask about it. Here’s how I did it, and why you might want to build one too.
Problems with my current solution
- Inputting the data manually: The data needed to be input manually, typing data from the Samsung Health and Withings, and LoseIt! apps into tables. This is ok when I’ve got the time and motivation, but this can slip when I’m busy, tired, or stressed.
- Visualising the data: Currently, I’m using Obsidian with the Advanced Tables plugin to log data and the Charts plugin to display it. This worked nicely on my computer, but didn’t display so well on my phone. Also it’s restricted to charts only, I’d like to try other visualisations.
- Keeping on track: I’m setting 12-week (90 day) goals. Around weeks 6-10 I start to slip, getting sloppy with tracking and my targets. Having a dashboard I can see every day that’s updated automatically should help with that.
What I set out to improve
- One source of truth: I want one beautiful dashboard that gets updated daily, in a highly visible place that I will look at regularly.
- More, more beautiful, visualisations: A graph is nice, but I want other visualisations that tell the story better and look cooler.
- Automating data collection: No more manual data entry, everything from data recording, to collection, and visualisation should be done without my input.
- Tracking against targets: I want to see my progress towards my targets, not just my daily numbers. If I’m slipping I should be able to see that and by how much.
- Showing off: So this is my ego talking, but I’d love to share my progress with guests, and having a cool dashboard visible in the house would be a talking point.
- Expanding my skillset: I want a project that I can learn new technologies.
The Solution: My self-hosted health dashboard
As of today, I have a simple dashboard set-up that is automatically recording my weight and step count data, which I can display on a tablet or monitor over WiFi.
Next Steps
- Improve the dashboards: I’ve been learning InfluxQL and how to set up various Grafana dashboards. I’d like to improve the visualisations and add tracking against targets, which I haven’t fully got my head around yet.
- Add more data: I’m only tracking weight and step count, I’d like to add a calorie count tracker but LoseIt! doesn’t share that data with Health Connect, so I need to find another way to do it.
Technical Details
Infrastructure
- A Raspberry Pi 4 running Docker with Grafana and InfluxDB.
- My Android phone running Health Connect and Tasker.
Technologies
Grafana
- I’m using a self-hosted Grafana Enterprise image to display the dashboards
- While Grafana has a free cloud plan, I decided to self-host, so my data stays with me and I can improve my Docker-foo
InfluxDB
- I picked InfluxDB to store the health data. I looked at Prometheus as well, but my understanding was that Prometheus fetches data from external services, whereas you “push” data to InfluxDB, which is better for my set-up, where I will be sending data to it via HTTP requests from Tasker.
Tasker
- I’m using Tasker along with the TaskerHealthConnect plugin to extract my aggregated health data from Health Connect.
- I wrote a bit of JavaScript to convert the aggregated health data JSON object to InfluxDB line protocol, which Tasker submits to InfluxDB via HTTP POST requests.
- I could have written my own app to connect to Health Connect and send the data to InfluxDB, but Tasker with the TaskerHealthConnect plugin is already perfect for my use case.
Health Connect
- I’m using the Health Connect app to consolidate data from Samsung Health, Google Fit, Withings and LoseIt!.
- Unfortunately, LoseIt! doesn’t seem to share food logs or calorie data with Health Connect, so I will need to look at other solutions.
Replicating my set-up
If you’d like to set-up your own health dashboard, you can use the Github link below, where I’ve published the project files, along with a readme to get started. https://github.com/WildPress/quantified-self
How are you tracking your health data?
If you’re already tracking health data with your own system - maybe it’s Python scripts, Notion databases, or like how I did it with Obsidian with plugins - I’d love to hear what’s working and what isn’t.
What made you come up with your own solution, and what problems are you still trying to solve?
If you try out my script, let me know how you get along and what dashboards you create! I will update this post as I create more.