InfluxDB to Exist.io - Logging Gaming Time

existio, tracking, lifelogging, python

Getting as much data into Exist as I can is important to me. So far this year I’ve built integrations for…

This post details how I am tracking gaming time. I found a method around Christmas 2019 that lets you retrieve accurate playtime from your Nintendo Switch via the parental controls app/feature. This was cool, but I don’t always play things on my Switch, so we had to go deeper!

Taking that a bit further, I discovered a project on Github that tracked all of this data (and more!) into ‘InfluxDB’. InfluxDB is a ‘time series’ database, and as such is really good at storing data like the amount of time you played in a day, the temperature of your living room, or the level of sunlight your house receives at intervals throughout the day.

You can then visualise this data with ease in ‘Grafana’ - I played around with the gaming dashboard available from the previously mentioned project, and tailored it for the data I want to see. For example, I don’t care about achievements so they got removed from the dashboard layout.

Grafana Gaming Time Dashboard

To take this a step further, I wrote a small python script that retrieves playtime for a given day and submits it to Exist.io. This let’s it become a part of the trend and correlation engine that powers the Exist dashboard.

Script Output

Exist Media Dashboard

Exist Gaming Day of week averages

My python code can be found https://github.com/jleighton/influx_gaming_to_exist. I have this code submitting to exist.io every hour on a cronjob. The code that retrieves Switch playtime runs every 4 hours during the day, Steam and Rescuetime run hourly (just before the Exist push happens)

What this means is that whether I play something on Steam, other PC games like OpenTTD, or my Nintendo Switch all the playtime gets captured and logged without a second thought. It just works, and that’s awesome.

I realised that I then needed someway of logging playtime on systems that can’t automatically post their data; such as my trusty 3DS, Snes Classic, and any games I play on my phone or tablet. This is a topic for another post, but what I did was build a small python based web interface (Flask based) to log playtime. Sneak peak below…

Web form to submit Nintendo 3DS Playtime

Leave a Comment

I'd love to hear from you! Use the button below to email me with any thoughts, or feedback (and if you'd like your comment published or not).

Your email address won't be used for any other purpose than replying.