
Important
This project is looking for a new maintainer or co-maintainer
Over the past few months, I have not been able to spend as much time as this project deserves on support, maintenance, and development.
Rather than let the project stall, I would like to find someone who is interested in helping maintain it, either together with me or as the new primary maintainer.
If you use Nightscout Clock, have contributed before, or are interested in supporting an open-source project that helps caregivers monitor their loved ones’ glucose values, please get in touch.
You can reach me at artiom@gmail.com.

Nightscout Clock (or NSClock) is an open-source product aimed at helping caregivers of people with type 1 diabetes have peace of mind by being able to better monitor their loved ones' blood glucose values.
- 8 colorful clockfaces
- Can get glucose data from Dexcom Share, Nightscout, LibreLink Up or Medtrum EasyFollow
- Supports mg/dl and mmol/l
- 10 minutes setup through web browser
- Configurable low/high limits
- Audible alarms in case the blood sugar is too low or too high
- Automatic brightness adjustment
- Notifies of stall data
- ...and more

Thanks @CallumMcK
- Buy Ulanzi TC001, it is about $50, so you don't have to sell a kidney, it is available both in US and Europe (Aliexpress sells it as well, for the same price)
- Wait a few days for the delivery
- Unpack, turn on (press on < and > buttons for a few seconds)
- Connect the USB-C cable (comes with the clock) to your computer
- Go to the installation page
- Follow the instructions. If the installation fails (error messages during installation, read this
- Once the clock installed, take out your phone and join nsclock wi-fi network. Then go to http://192.168.4.1/
- Set up your device, provide the Wi-Fi network details, your Dexcom, Nightscout, LibreLink Up or Medtrum EasyFollow credentials, glucose warning limits and other parameters
- You're all set, enjoy!

Thanks @CallumMcK
More information for people who needs it
Nightscout Clock is a custom firmware for Ulanzi TC001. It can also run (with minor changes) on AWTRIX-Light custom hardware, so if you need a bigger display, feel free to research.
| Name |
Look |
Comment |
| Simple |
 |
Horizontal bars in the bottom of the display indicate the time since the last reading No bars: less than one minute 1..5 green bars: 1..5 minutes 5 yellow bars: 6..19 minutes value and bars use the configured old-data color from 20 minutes (default threshold) and the trend arrow is replaced by an X in the same color |
| BIG DIGITS |
 |
|
| 3-hours graph |
 |
|
| Graph and value |
 |
The dots on the right side replace the trend arrow. 2 white dots = horizontal arrow. 2 colored dots (white + green) = 45° arrow. 3 dots = vertical arrow. 4 dots = double arrow. Colored dots above = upward trend. Colored dots below = downward trend.
Dots under the value are the same as horizontal bars on the other faces. See "Simple" face for details |
| Delta |
 |
|
| Time and value |
 |
The dots on the right side replace the trend arrow. 2 white dots = horizontal arrow. 2 colored dots (white + green) = 45° arrow. 3 dots = vertical arrow. 4 dots = double arrow. Colored dots above = upward trend. Colored dots below = downward trend.
For the bottom-side bars see "Simple" face for details |
| Unicorn |
 |
Rainbow mane for normal readings, warning or urgent colors outside the configured limits, and the configured old-data color for stale readings. Age bars appear below the value. |
| Time only |
|
Only the time: hours, minutes and seconds in 24-hour format, or hours, minutes and AM/PM in 12-hour format. Glucose is always hidden, including urgent readings and old or missing data. New glucose alarms are suppressed while this face is selected. Alarms already triggered, including snoozed alarms, continue normally. |
The Web UI's Clock faces card selects which faces are active. All of them are active out of the box, and so is any face added by a later update; turning off the ones you never use shortens what the left and right buttons move between, and the default face is chosen among the active ones.
Automatic clock-face cycling
Automatic cycling can be enabled in the same card, and runs through the active faces in the order shown, so at least two of them must be active. Choose how often the face should change: 10 or 30 seconds, or 1, 2, 3, or 5 minutes.
While cycling is enabled, the left and right buttons restart the interval without stopping automatic cycling. The default-face setting is hidden until automatic cycling is turned off again.
Face and brightness schedule
Under Device settings the clock can change its face and brightness on a schedule. Each row gives a time of day, a face and a brightness, either a manual level or one of the automatic modes. From that time the clock shows that face at that brightness until the next row, and the last row of the day runs overnight, so a Big text row in the morning and a Simple row at brightness 1 in the evening make a bedside clock that is readable by day and easy to sleep next to. The buttons still change the face between rows. The schedule and automatic cycling cannot both be on, and a clock that does not know the time yet stays on its default face.
Configuration web interface

The Backup and restore card on the System tab downloads the clock's settings as a file and loads such a file back into the page, where you review it and save; WiFi settings are loaded only when you ask, and the web login never is. The file contains your WiFi and data source passwords, so keep it private.
High, low, and urgent-low alarms each have their own threshold, snooze duration, sound, and optional alert windows in the Web UI.
- Choose one or more alert windows by weekday and start/end time. With no windows, an enabled alarm can sound at any time. Windows use the clock's configured timezone; an overnight window starts on the selected weekday and continues into the next morning. If the clock has not obtained the time yet, it allows alarms regardless of their windows.
- Set the repeat interval to 1, 2, or 5 minutes (default). Intensive mode overrides this and repeats every 2 seconds.
- Choose the default sound, one of six sound presets, or a custom RTTTL melody. The Try button plays the current melody on the clock without saving, even if that alarm is disabled.
Features (technical stuff, feel free to ignore)
- Web-based installation (no need to install flashing tools, you just need the clock and a web browser). The clock hosts a website where the user can configure all the parameters (data source, limits, alarms, display)
- Access-Point mode to set the initial configuration
- Support for a secondary WiFi (e.g. if you want to take the clock in your car for a long trip)
- Support for WPA-Enterprise
- Ability to set a custom hostname in case you have multiple NSClocks on the same network
- Simple glucose value display with trend arrow
- Changing color based on limits
- Nightscout data source, the clock gets units type and value boundaries from Nightscout (see how to set up using Nightscout.pro as data source)
- Juggluco data source (support for HTTP Nightscout endpoints)
- Improve WiFi compatibility (setting up WiFi during the installation)
- Gluroo data source (API_SECRET within the URL parameters) (see how to setup video)
- Simplified Nightscout API like xDrip+ Open Web Service support. When adding it as a data source, choose Nightscout and check the Simplified API checkbox. Make sure your source device (e.g. your phone running xDrip) has a static IP address and is on the same WiFi network. Also don't forget to check the port setting; for xDrip it is usually 17580
- Dexcom Share data source
- LibreLinkUp (libreview) data source
- Medtrum EasyFollow data source
- Medtronic users can bridge data through xDrip+ to Nightscout, then connect the clock to that Nightscout site. See discussion #53
- Brightness adjustment
- Brightness can be adjusted within the Web UI
- Automatic brightness adjustment based on the ambient light
- Double-click on the middle button on the clock turns the display on and off
- Multiple clock faces support
- Default clock face can be selected in the Web UI
- Clock faces can be changed using arrow buttons on the clock
- Faces you do not use can be turned off in the Web UI
- Active clock faces can cycle automatically at a configurable interval
- Face and brightness can follow a daily schedule
- Simple clock face (value and trend arrow)
- Full-width glucose graph
- Graph, value and trend indicator
- BIG DIGITS
- Value, trend and delta
- Clock and BG value (timezone is set in the clock's web interface)
- Unicorn and glucose value, with mane colors based on glucose limits
- Time only, always hiding glucose and suppressing new alarms while selected; already-triggered alarms continue normally
- Configurable color for old readings and no-data screens: gray (default), cyan, magenta, or blue. Choose it on the Display tab of the Web UI; the alternatives help keep stale readings visible at low brightness
- Smart data and screen update timings: read data once it appears, refresh screen when needed
- API data source. The clock has a simple Nightscout-like API which can receive glucose values from an external source. The main purpose of this feature is the ability to test the clock during the clockfaces development. In order to activate this feature, select the API data source within the clock's Web UI. Here are the endpoints:
- /api/v1/entries POST endpoint receives an array of Nightscout-like entries. The only significant fields are sgv, date and trend or direction. Due to the limited memory the API is stable when sent less than 10 recotds
- /api/v1/entries DELETE endpoint deletes all entries regardless of the payload
- Firmware versioning
- Alarms with configurable thresholds, snooze times, repeat interval, sounds, and weekday/time alert windows
- To turn the device on or off press both arrow buttons for 3 seconds
- To reset the device to factory defaults (hard reset) during boot sequence (when version number is displayed) keep the center (select) button pressed.
- Add more clock faces
- Battery, humidity and temperature
- Smooth color change (rainbow) based on the value and boundaries
- Add more data sources
- ...more... (if you are the author of a CGM data collecting app/service and you want your data to be displayed on the Nightscout Clock, please contact me)
- Added the Unicorn clock face, showing glucose beside a unicorn whose mane changes color with glucose limits, thanks @JuanMiste (#181)
- Added configurable colors for old readings and no-data screens, with gray, cyan, magenta, and blue options, thanks @nishanm (#177)
- Replaced fixed alarm silence intervals with per-alarm alert windows supporting weekday selection, multiple windows, and overnight schedules, thanks @nishanm (#183)
- Added a configurable alarm repeat interval of 1, 2, or 5 minutes; intensive mode still repeats every 2 seconds, thanks @nishanm (#184)
- Added six alarm sound presets alongside the default and custom RTTTL melodies, thanks @nishanm (#185)
- Improved Dexcom credential guidance and added password-manager autocomplete hints, thanks @miqcie (#154)
- Fixed oversized no-data text and clock rendering after switching from a face that uses large text, thanks @nishanm (#177)
- Centralized clock face definitions to simplify adding new faces, thanks @nishanm (#188)
- Added automatic cycling between selected clock faces, with Web UI validation requiring at least two faces, configurable intervals from 10 seconds to 5 minutes, and left/right navigation limited to the selected faces
- Addressed screen refresh, now there should be less flickering due to partial refresh
- Fixed a potential issue in Improv protocol handling (setting wifi from the installation page)
- Fixed a potential filesystem corruption on restarts
- Added Medtronic setup guidance to the WebUI, closes #147
- Added web auth in the advanced settings. (discussion), thank you @mrendo
- Added show password option on all password fields, thank you @mrendo
- Fixed local WebUI password visibility icons after the changes from #125
- Fixed email parsing Medtrum credentials input, thanks @logicafuzzy, merged #127
- Added support for xDrip+ Open Web Service as an extension of the Nightscout data source, resolving #86
- Medtrum EasyFollow data source support (discussion), inspired by @pachi81's work
- Fixed Open WiFi networks validation
- Moved trend indicator to the right in the "Time and value" clockface
- Implemented LibreLink Up patient selection for multi-patient accounts. Fixed #65
- Fixed a typo in the WebUI javascript
- Added trend indicator to the clock-and-value clock face. #49
- Added manual brightness control from the device itself. When the brightness is in manual mode, pressing < or > for more than a second increases or decreases brightness. Setting persists over restarts. #74
- Fixed support for Dexcom Japan
- Added custom alarm melodies, which can be set through RTTTL strings in alarm settings
- Added support for Dexcom Japan: #110
- Fixed typo in Dexcom credentials error message: #111
- Implemented Alarm Intensive Mode, addressing #61
- Fixed WiFi password validation for Open WiFi networks
- Added possibility of factory resetting the device on start-up (when version string is displaying press the select button)
- Better AP mode handling
- Implemented open WiFi connectivity, closing #105
- Changed age bars colors so that they do not disappear when the brightness is minimal. #101
- Increased version presented to LibreLinkUp servers, closing #88
- Added "dark rooms" brightness mode and changed curve for the manual brightness. Thanks @unxmaal for #67
- Fixed trend arrow display on the Big Text clockface when brightness is not in auto mode. #47
- Adjusted version display on start-up
- Added version number, update check and link to the updating page to the WebUI. #10
- Added development environment setup instructions. #26
- Fixed LibreLink Up Server label. #50
- Fixed delta for LibreLinkUp source
- Now I can consider LibreLinkUp as being functioning. So closing #9 and #27
- Yet another attempt to fix LibreLinkUp
- Another attempt to get values from LibreLinkUp
- Fixed Nightscout domain name validation, closed #39
- Added API endpoint to switch display power on and off as in the example below
curl -X POST http://nsclock.lan/api/displaypower \
-H "Content-Type: application/json" \
-d '{"power": "off"}'
- Another attempt to fix #25 and #31
- Fixed delta showing 0 when there are multiple sources uploading data to Nightscout. #25
- Implemented WPA-Enterprise connectivity (Wifi type selector available for additional WiFi network). #23
- Fixed project dependencies divergence. #30
- Implemented possibility of setting custom hostname. #18
- Implementing possibility of having additional WiFi network. #7
- Updated README to be more customer-friendly
- Started preparing for LibreLink Up data source integration, #9)
- Improved memory management to avoid NOMEMORY issues and unplanned restarts, #19
- Improved WiFi SSID validation, #16
- Fixed typos in Web UI (thanks @motinis)
- Finished alarms feature
- Improved WiFi reconnection handling #15
- Migrated development environment to Linux
- Removed boot sound
Do you want to contribute?
Please read the Contriburing instructions
The code is heavily inspired by (has a lot of copy-pasted code from :D ) AWTRIX Light project.