Robyn's Blood Sugar Live Feed

Time in range (last 24h)

Time in range

Time in range rolling average

Technical explanation

This is a live-updating graph of my blood sugar level. I am currently using the Simplera app on Android as my CGM display. I realised that the app sends out a notification every five seconds or so with the format '9.8 mmol/L'. This annoyed me at first, because it was constantly taking up space on my lock screen, but then I realised I could use it for the evilz >:D

I use MacroDroid to capture the data from each notification with a regex filter. I then send this text to the server, which stores it in a MongoDB collection. As the server is constantly receiving requests, on the back end I made it so that a data point is only saved if the value has changed. That way, I have a list of every time the value changes, and what the new value is.

I then plot this data using chart.js.

Some other notes: the Simplera app limits its data output to between 2.9 and 22.2 mmol/L. This differs from other CGM apps such as Freestyle Libre, which will display data from 2.9 up to 27. I suppose for therapeutic purposes it doesn't really matter how high or low you are after that point, the procedure is still the same: fix it!

Simplera sometimes sends notifications with text such as 'Glucose level high', instead of a numeric value. My MacroDroid macro records this as 0, and sends this to my server. On the server-side, I just tell it to discard any readings that come in where the value is 0. I felt like that would be easier than making some kind of crazy regex filter.

Links