mddub / urchin-cgm

A graph of your CGM data on a Pebble watch.
MIT License
56 stars 45 forks source link

A Pebble watchface to view data from a continuous glucose monitor in graph format, like this:

Screenshot

To install, enable Developer Mode in the Pebble app on your phone, then open this pbw file in the Pebble app.

Urchin CGM is an Unopinionated, Ridiculously Configurable Human INnterface to your CGM. It's not released yet / in beta / a work-in-progress.

Circle CI

Setup

Layout

The layout is one of the most Ridiculously Configurable aspects of Urchin. The settings page includes a handful of pre-set layouts to get you started:

Use one as a starting point to build your own watchface: reorder the elements, change heights and colors, toggle borders, move the icons...

Graph

Set the bounds and target range of the graph on your phone.

You can choose the shape and size of the points on the graph so that the glucose history is as long or as short as you want. To show up to 12 hours of BGs, plot the points super-thin or overlapping. For a "sparkline" view of the last hour, plot bigger points with more space in between.

Status bar content

The status bar can display content from a variety of sources:

The recency indicator in the status bar is configurable. You can choose the format ((3), 3:, etc.) and the conditions under which it is shown (for example, "don't show the recency as long as it's fewer than 10 minutes old," or "don't show the status at all when it's more than 30 minutes old")

Pump data

If you are using Nightscout to track data from an insulin pump, you may choose to display bolus history (as ticks) and/or basal history (as a bar graph):

To enter pump data manually, you can use Nightcout Care Portal or the "CarePortal" Pebble app.

To upload pump data automatically, you can use RileyLink or Loop on iOS, or build an OpenAPS uploader.

Predictions

Like pump data, predicted future BGs can be plotted if you are using Loop on iOS, or OpenAPS with the Advanced Meal Assist (AMA) feature of the oref0 algorithm. For example, AMA generates three different projections assuming no carbs, normal carb absorption, and accelerated carb absorption.

What do the icons mean?

The data that you see on your watch travels like this: Sensor/Receiver -> Server -> Phone -> Pebble.

There is a problem with the Phone -> Pebble connection: it's been a while since your watch has been able to reach your phone. Maybe your phone is out of range. Maybe it's on airplane mode. Maybe you need to charge your phone.

There is a problem with the Server -> Phone connection: it's been a while since your phone has been able to reach the server. Maybe your phone's network connection is bad. Maybe your Nightscout server / Dexcom's server is down.

There is a problem with the Sensor/Receiver -> Server connection: the latest data on the server is old. Maybe there's a problem with your receiver or uploader. Maybe the sensor fell out.

When the watch fails to fetch data, a message describing the problem briefly appears in the graph.

Contributing

Contributions are welcome in the form of bugs and pull requests. To report a bug or provide feedback, please file an issue. To contribute code, please use the instructions below to build and test the watchface.

Tips:

Testing

Since this software displays real-time health data, it is important to be able to verify that it works as expected.

The most effective method of integration testing I've found is to compare screenshots. This relies on ImageMagick to compute diffs. Screenshot tests and JavaScript unit tests are run automatically by CircleCI.

To do:

Disclaimer

This project is intended for educational and informational purposes only. It is not FDA approved and should not be used to make medical decisions. It is neither affiliated with nor endorsed by Dexcom.