Nightscout Variables

These are some variables that are useful for Loopers.

  • The first item shows common Nightscout Variables used by Loopers with some comments and suggestions
  • Click on Template for nsconfig for a version of the file you can copy and edit for your own site

To learn more about these and other variables, visit the Nightscout docs

Here’s what you can find on this page:

  1. Nightscout Config Vars
  2. Google Cloud Nightscout Config Vars
  3. Google Cloud Template for nsconfig file
  4. Northflank: APNS_Key

Formatted for Google Cloud Nightscout

You can delete everything that was put into your nsconfig file by default (the “Edit variables” option in the menu) and replace it with the lines copied from below.

Lines that start with # are disabled. To enable a disabled line, just delete the # at the beginning. To disable a line, either add a # to the beginning of it or delete the line completely with control-k.

When adding other variables, be sure to follow the format of the variables below. Take note of upper/lower case and make sure your quotes are vertical/dumb and not slanted/smart.

"vertical/dumb" not “slanted/smart”

Template for nsconfig file

Click on any line below to copy the text so you can edit it to be suitable for your nsconfig file. You will see Copied to Clipboard appear briefly.

# Replace YOUR_INFO_HERE with your API secret
export API_SECRET="YOUR_INFO_HERE"
#
# If you use mmol/L, change the next line to mmol/L
export DISPLAY_UNITS="mg/dl"
#
# When set to "denied", access to your site will be require a token or the API_SECRET
# To allow anyone with your NS URL to be able to run reports and see current and past data,
# set it to "readable"
export AUTH_DEFAULT_ROLES="denied"
#
export ENABLE="loop pump iob cob basal careportal sage cage bage override dbsize"
# If you want to use bridge, disable the previous line and enable next line instead
#export ENABLE="bridge loop pump iob cob basal careportal sage cage bage override dbsize"
#
# Replace YOUR_INFO_HERE with whatever text you want in the upper left corner of your NS
export CUSTOM_TITLE="YOUR_INFO_HERE"
#
# Change any alarms you want to enable to "on"
export ALARM_HIGH="off"
export ALARM_LOW="off"
export ALARM_TIMEAGO_URGENT="off"
export ALARM_TIMEAGO_WARN="off"
export ALARM_URGENT_HIGH="off"
export ALARM_URGENT_LOW="off"
#
# These values set when your alarms get triggered and what bg your dots change color at. These are the
# default values, but consider setting them to 60,70,140,180 for a tighter range, or whatever you'd like.
export BG_HIGH="260"
export BG_TARGET_TOP="180"
export BG_TARGET_BOTTOM="80"
export BG_LOW="55"
#
export BASAL_RENDER="default"
export BOLUS_RENDER_FORMAT="minimal"
export BOLUS_RENDER_FORMAT_SMALL="default"
export BOLUS_RENDER_OVER="0.1"
export DBSIZE_MAX="20000"
export DEVICESTATUS_ADVANCED="true"
export LOOP_ENABLE_ALERTS="false"
export PUMP_ENABLE_ALERTS="false"
export PUMP_FIELDS="reservoir battery clock"
export SCALE_Y="linear"
export SHOW_FORECAST="loop"
export SHOW_PLUGINS="loop pump cob iob careportal basal sage cage bage override dbsize"
export SHOW_RAWBG="never"
export THEME="colors"
export TIME_FORMAT="24"
#
# If you use Dexcom Share Bridge:
export BRIDGE_PASSWORD="YOUR_INFO_HERE"
export BRIDGE_SERVER="US"
export BRIDGE_USER_NAME="YOUR_INFO_HERE"
#
# If you use remote overrides/carbs/boluses
export LOOP_APNS_KEY="YOUR_INFO_HERE"
export LOOP_APNS_KEY_ID="YOUR_INFO_HERE"
export LOOP_DEVELOPER_TEAM_ID="YOUR_INFO_HERE"
# If you built Loop last with Diawi, TestFlight, or iTunes, enable the next line
#export LOOP_PUSH_SERVER_ENVIRONMENT="production"

Northflank:  LOOP_APNS_KEY

Northflank is one of the few free Nightscout options.  We’re including the instructions here for the Northflank LOOP_APNS_KEY, which is used as part of the remote command configuration since this is a frequently asked question on Facebook.
When you paste the APNS key into Northflank, there will be spaces between the lines of the key, after the BEGIN PRIVATE KEY and before END PRIVATE KEY.

  1. Remove the spaces, “Update & restart”.
  2. Check the APNS key under the JSON.
  3. There may be an extra forward slash “\” present that should be deleted.
Skip to content