Nightscout
Deze pagina is vertaald door PageTurner AI (beta). Niet officieel goedgekeurd door het project. Een fout gevonden? Probleem melden โ
Watโ
Nightscout (CGM in the Cloud) is een open source, DIY-project dat realtime toegang tot CGM-gegevens mogelijk maakt via een HTTP REST API. Het wordt gebruikt voor het veilig op afstand bekijken van bloedsuikerdata vanaf elke locatie...inclusief Oh My Posh-segmenten in de opdrachtregel!
Voorbeeldconfiguratieโ
Dit voorbeeld gebruikt standaard mg/dl omdat de Nightscout API de glucosewaarde (.Sgv) in mg/dl-formaat verstuurt. Hieronder staat ook een template voor het weergeven van de glucosewaarde in mmol/L. Wanneer je verschillende kleurbereiken gebruikt, moet je je hoge en lage glucosewaarden met 18 vermenigvuldigen en deze waarden in de templates gebruiken. Denk ook na over je achtergrond- en voorgrondkleuren. Gebruik bijvoorbeeld geen witte tekst op een gele achtergrond.
Het foreground_templates-voorbeeld hieronder kan worden ingesteld op slechts รฉรฉn kleur,
mits die kleur zichtbaar is tegen elk van je achtergronden.
- json
- yaml
- toml
{
"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
}
}
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
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
Of geef weer in mmol/l (in plaats van de standaard mg/dl) met de volgende template:
- json
- yaml
- toml
{
"template": "๎ก {{ if eq (mod .Sgv 18) 0 }}{{divf .Sgv 18}}.0{{ else }} {{ round (divf .Sgv 18) 1 }}{{ end }}{{ .TrendIcon }}"
}
template: ๎ก {{ if eq (mod .Sgv 18) 0 }}{{divf .Sgv 18}}.0{{ else }} {{ round
(divf .Sgv 18) 1 }}{{ end }}{{ .TrendIcon }}
template = "๎ก {{ if eq (mod .Sgv 18) 0 }}{{divf .Sgv 18}}.0{{ else }} {{ round (divf .Sgv 18) 1 }}{{ end }}{{ .TrendIcon }}"
Optiesโ
| Name | Type | Default | Description |
|---|---|---|---|
url | template | Your 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 | |
headers | map[string]string | A key, value map of Headers to send with the request | |
http_timeout | int | 20 | in 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 |
Je kunt de trendiconen aanpassen, de trend elders plaatsen, tekst toevoegen - net wat je wilt! Zorg dat je NerdFont het gewenste glyf bevat of zoek er een.
| Icoon | Beschrijving |
|---|---|
DoubleUpIcon | standaard โโ |
SingleUpIcon | standaard โ |
FortyFiveUpIcon | standaard โ |
FlatIcon | standaard โ |
FortyFiveDownIcon | standaard โ |
SingleDownIcon | standaard โ |
DoubleDownIcon | standaard โโ |
Template (informatie)โ
{{ .Sgv }}
Eigenschappenโ
| Name | Type | Description |
|---|---|---|
.ID | string | The internal ID of the object |
.Sgv | int | Your Serum Glucose Value (your sugar) |
.Date | int | The unix timestamp of the entry |
.DateString | time | The timestamp of the entry |
.Trend | int | The trend of the entry |
.Device | string | The device linked to the entry |
.Type | string | The type of the entry |
.UtcOffset | int | The UTC offset |
.SysTime | time | The time on the system |
.Mills | int | The amount of mills |
.TrendIcon | string | By default, this will be something like โโ or โ etc but you can override them with any glyph as seen above |