Saltar al contenido principal

Nightscout

Traducción Beta No Oficial

Esta página fue traducida por PageTurner AI (beta). No está respaldada oficialmente por el proyecto. ¿Encontraste un error? Reportar problema →

Qué hace

Nightscout (CGM en la Nube) es un proyecto de código abierto y DIY que permite el acceso en tiempo real a datos de CGM mediante una API REST HTTP. Se utiliza para visualizar de forma remota y segura datos de glucosa desde cualquier lugar... ¡incluyendo segmentos de Oh My Posh en la línea de comandos!

Configuración de ejemplo

Este ejemplo utiliza mg/dl por defecto porque la API de Nightscout envía el valor de glucosa (.Sgv) en formato mg/dl. A continuación también encontrarás una plantilla para mostrar el valor de glucosa en mmol/L. Cuando uses diferentes rangos de colores, debes multiplicar tus valores altos y bajos de glucosa por 18 y usar estos valores en las plantillas. También deberás considerar los colores de fondo y primer plano. Por ejemplo, evita usar texto blanco sobre fondo amarillo.

El ejemplo de foreground_templates a continuación podría configurarse con un solo color, si ese color es visible sobre cualquiera de tus fondos.

{
"type": "nightscout",
"style": "diamond",
"foreground": "#ffffff",
"background": "#ff0000",
"background_templates": [
"{{ if gt .Sgv 150 }}#FFFF00{{ end }}",
"{{ if lt .Sgv 60 }}#FF0000{{ end }}",
"#00FF00"
],
"foreground_templates": [
"{{ if gt .Sgv 150 }}#000000{{ end }}",
"{{ if lt .Sgv 60 }}#000000{{ end }}",
"#000000"
],
"leading_diamond": "",
"trailing_diamond": "",
"template": " {{ .Sgv }}{{ .TrendIcon }}",
"options": {
"url": "https://YOURNIGHTSCOUTAPP.herokuapp.com/api/v1/entries.json?count=1&token=APITOKENFROMYOURADMIN",
"http_timeout": 1500
}
}

O muestra en mmol/l (en lugar del predeterminado mg/dl) con la siguiente plantilla:

{
"template": " {{ if eq (mod .Sgv 18) 0 }}{{divf .Sgv 18}}.0{{ else }} {{ round (divf .Sgv 18) 1 }}{{ end }}{{ .TrendIcon }}"
}

Opciones

NameTypeDefaultDescription
urltemplateYour Nightscout URL, including the full path to entries.json AND count=1 AND token. Example above. You'll know this works if you can curl it yourself and get a single value
headersmap[string]stringA key, value map of Headers to send with the request
http_timeoutint20in milliseconds - how long do you want to wait before you want to see your prompt more than your sugar? I figure a half second is a good default
información

¡Puedes cambiar los iconos de tendencia, colocar la tendencia en otro lugar, añadir texto, como prefieras! Asegúrate de que tu NerdFont incluya el glifo que deseas o busca uno.

IconoDescripción
DoubleUpIconpor defecto ↑↑
SingleUpIconpor defecto
FortyFiveUpIconpor defecto
FlatIconpor defecto
FortyFiveDownIconpor defecto
SingleDownIconpor defecto
DoubleDownIconpor defecto ↓↓

Plantilla (info)

plantilla predeterminada
 {{ .Sgv }}

Propiedades

NameTypeDescription
.IDstringThe internal ID of the object
.SgvintYour Serum Glucose Value (your sugar)
.DateintThe unix timestamp of the entry
.DateStringtimeThe timestamp of the entry
.TrendintThe trend of the entry
.DevicestringThe device linked to the entry
.TypestringThe type of the entry
.UtcOffsetintThe UTC offset
.SysTimetimeThe time on the system
.MillsintThe amount of mills
.TrendIconstringBy default, this will be something like ↑↑ or ↘ etc but you can override them with any glyph as seen above