loading...
Cover image for Visualize your 2019 physical activity in a Grafana dashboard

Visualize your 2019 physical activity in a Grafana dashboard

yannbertrand profile image Yann Bertrand ・1 min read

I've been owning an Apple Watch for more than a year now. It's a really impressive device, I've found myself recording all the Workouts I did pretty naturally.

Unfortunately, Apple's Activity app is far from ideal when you want to play with your data and display custom charts.

So I decided to try to improve that by downloading my data and put it in a dedicated product for data visualization.

Visualizing my activities by type

Talking about it with my colleagues, they showed me Grafana and InfluxDB.

As I'm working daily with JavaScript and I wanted to build something quick, I went with Node.js to parse the raw data from my Apple Watch and insert it inside the InfluxDB database which is directly read by Grafana.

It was the first time I had to work with Node streams since the file to parse is huge. It was quite a challenge but exciting as well!

Vizualising my bicycle activity through 2019

I had a lot of fun building it and it feels good to do something I find useful 😁

Hopefully, you'll like it to.

Please create your own dashboard and show it to me!

GitHub logo yannbertrand / apple-watch-workouts-year-review

Visualize your 2019 activity in a Grafana dashboard

Welcome to Apple Watch Workouts year review 👋

Build Status Version License: MIT Twitter: _YannBertrand

Stability: 1 - Experimental

Visualize your Apple Watch workouts of the year in a Grafana dashboard

Demo

Summary example screenshot Types example screenshot Bicycle example screenshot

🏗 Install

Clone the repo using Git. You'll need Docker, Node.js (tested with v12) and Yarn (tested with v1.21.1).

yarn install

🚀 Usage

The project runs an InfluxDB database and a Grafana instance, launch them with docker-compose:

docker-compose up -d

In the meantime, export your Apple Watch data from your iPhone. In the Health App:

Click on your picture Export All Health Data Export

Send the zip file to your computer.

Then run:

yarn start <path_to_export.zip>

Grab a coffee while your data is read and inserted in InfluxDB (my data takes more than a minute to be loaded)!

📈 Once the script ends, your Grafana dashboard should be available at http://localhost:3000/d/apple-watch-workouts/year-dashboard?orgId=1.

This dashboard is just a proof of concept, take full advantage of Grafana, try to edit the panels…

Discussion

pic
Editor guide