DEV Community

Cover image for Visualize your 2019 physical activity in a Grafana dashboard
Yann Bertrand
Yann Bertrand

Posted on

5 3

Visualize your 2019 physical activity in a Grafana dashboard

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…

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay