Skip to content

Nightscout with Loop

Adding Loop to Existing Nightscout Site

Many people may already have an existing Nightscout site setup from before adding Loop to their management strategies. In order to make the most of your Looping setup, you will need to modify your existing Nightscout site a bit specifically for Loop. The process is pretty easy and should not take long.

The graphics on this page are from a Heroku implementation for DIY Nightscout. When you read the Nightscout documents, you'll notice there are a lot more options than just Heroku. When Heroku announced that the "free" tier for Heroku would be disabled in November 2022, the #WeAreNotWaiting community developed a lot of options - both free DIY, nominal cost DIY and there were already several companies that provide Nightscout as a service. If your site is not with Heroku, you need to translate how to adjust the configuration variables.

Variables for Loopers

Once you have created a Nightscout site, there are some Nightscout Config Vars specific to Loop.

  • First the Config Vars need to be added to the Nightscout site.

  • For each instance of viewing the Nightscout site (i.e., on broswer or phone app), you can individually select which of those configured items are displayed. This is on a per-view basis. However, Config Vars like the SHOW_PLUGINS line allow you to preconfigure what will be shown by default.

Edit/Add Config Vars

These instructions are for people using Heroku, because that is the most common choice. If your Nightscout site is not on Heroku, this page provides a guide for the Config Vars used by Loop.

Login to your Heroku account, select the Settings tab near the top of the screen on your Heroku app.

img/heroku5.png

Click on Reveal Config Vars. Scroll down the bottom of the Config Vars lines until you find the last blank one. You are going to add several additional lines of config vars for Loop use; the DEVICESTATUS_ADVANCED and ENABLE lines are required, the others just make Nightscout more useful when Looping.

Omnipod Users can skip the Config Vars that begin with PUMP_. Those are useful for Medtronic users.

img/add_vars.jpg

ENABLE bridge loop pump iob cob basal careportal sage cage bage override dbsize

(Note: If you are an existing NS user, you likely already have an ENABLE line in this section of Heroku. Don't add a new one. Simply find the existing ENABLE line, click on the little pencil icon to the right of it, and add the words shown on the ENABLE line above to the existing words already on the enable line. Avoid duplicates. The remainder of the lines are likely going to be brand new additions to your Heroku settings.)
DEVICESTATUS_ADVANCED true
PUMP_FIELDS battery reservoir clock status
PUMP_RETRO_FIELDS battery reservoir clock status
SHOW_FORECAST loop
SHOW_PLUGINS loop pump cob iob sage cage careportal basal override dbsize
PUMP_ENABLE_ALERTS true
PUMP_URGENT_BATT_U 30

(This is the pump battery percentage that will trigger a red, urgent alert in NS.)
PUMP_URGENT_BATT_V 1.25

(This is the pump battery voltage that will trigger a red, urgent alert in NS.)
PUMP_URGENT_RES 10

(This is the reservoir volume that will trigger a red, urgent alert in NS.)
PUMP_URGENT_CLOCK 30
LOOP_ENABLE_ALERTS true
LOOP_WARN 20

(This is the minutes since Loop last successfully looped, the t1d will have a similar notification at this time through the Loop app. This will be a yellow alert in NS.)
LOOP_URGENT 60

(Same as the alert above, but will be red in color and have a shorter snooze option.)
BASAL_RENDER default

Click on Open App in the top right corner of your Heroku site.

img/open_app.jpg

Plugins Selection

Once you are viewing an instance of your Nightscout site (browser or app), you can adjust what this instance of the display will show.

Click on the "hamburger" menu - those three horizontal lines in the upper right corner of the main NS display.

Different sets of documentation call the three horizontal lines in the upper right of the Nightscout display different things such as:

  • Settings
  • Hamburger Menu
  • Drawer Menu

img/example.jpg

The graphic below shows some of the check boxes you can select. Make sure your basal render is selected to either default or icicle (personal preference for how the temp basals show as blue lines in NS site), adjust alarms (on or off), check the boxes that you’d like display as pills in the SHOW PLUGINS section (usually all of them), and then click save. (You are saving your display preferences, not modifying anything in the NS database.)

Note - Nightscout has been updated since this figure was generated.

img/settings_ns.jpg

Authenticate Site

If the current display of your NS site has been not authenticated, you will not be able to access certain portions of Nightscout such as the careportal, administration tools and remote overrides. There are two ways to authenticate.

  • Use API_SECRET to access all features of Nightscout

  • Use Tokens to generate a URL that opens with predefined role(s)

The use of tokens is documented at this link to the security page in the Nightscout documentation.

You can authenticate with your API_SECRET using either of these methods:

  • Click on the hamburger menu and scroll all the way to the bottom, click on authenticate and add your API_SECRET

  • Click on the Lock symbol on upper right on main display (requires careportal plugin to be enabled) and add your API_SECRET

An authenticated site, with careportal plugin enabled, will show a + at upper right of the main display instead of a lock symbol. Tapping on the + gives you access to the careportal.

Nightscout Version Update

If you are new to Loop and haven’t updated your Nightscout site for a while, check to see if there's an available update. Visit Nightscout: Update Instructions for directions on updating.

More Variables for Loopers

The list of Variables for Loopers above can be expanded if you want your site to automatically open with specific values and alarm settings.

This Loop and Learn: Nightscout Variables page, created for folks using the Google Cloud method to create a Nightscout site, has a convenient, expanded list.