Magic Mirror Module - Keep track of blood glucose levels with ease thru your magic mirror. Display real time blood glucose levels, with trends and warnings. Powered by Nightscout
- You need to have Nightscout enabled CGM
- You need to setup your own Nightscout website, please follow this tutorial
- Clone repository into
../modules/
inside your MagicMirror folder. - Run
npm install
inside../modules/MMM-Nightscout/
folder - Add the module to the MagicMirror config
- Run
git pull
inside../modules/MMM-Nightscout/
folder. - Run
npm install
inside../modules/MMM-Nightscout/
folder
MMM-Nighscout works with any public hosted Nightscout instance. Important is to verify that your instance is accessible over the public internet by visiting http(s)://YOURSITE (Example Azure: https://YOURSITENAMEHERE.azurewebsites.net or Heroku: https://YOURSITENAMEHERE.herokuapp.com). Please also verify that your site is showing your data as well before proceeding.
It is possible to use tokens for authenticating as well. The following is needed to set it up:
- Create a role with "api:*:read" as permissions.
- Create a subject and set it to use the role created in step 1.
- Copy the "Access token" from step 2 and paste into the config.js file in the "token" field.
modules: [
...
{
module: "MMM-Nightscout",
position: "top_left",
config: {
debug: true, //Optional: set to true if you want debug logs
baseUrl: 'https://YOURSITENAMEHERE.azurewebsites.net', //Required: Base url to your Nightscout webapplication. Please make sure to not have any traling /
colorEnabled: true, //Optional: set to true if you want to get colorful bs values. Default is false.
chartWidth: 350, //Optional: set chart width in px. Default is 350px.
chartHours: 4, //Optional: number of hours that chart tracks. Default is 4.
renderChart: true, //Optional: set to false if you dont want to get a chart. Default is true.
token: false, //Optional: use a token to authenticate against the Nightscout server.
showTIR: false, //Optional: set to true if you want to display TIR for the last <chartHours> number of hours.
units: false, //Optional: set to "mmol" to overwrite server settings and display data in mmol/L in case setting isn't read properly.
extendedHeader: false //Option: set to false if you want to hide server title and last glucose value.
}
},
...
]
Nightscout similar chart that has fully configurable dimensions. Support for color coding and possibility of tracking up to 24hrs of data.
Time in range calculation for displayed chart.
Supports both mmol/L and mg/dL
mmol/L
mg/dL
Set colorEnabled = true to render blood glucose level based on Nightscout thresholds (critical, warning, normal). Default is false.