nightscout / trio-oref

MIT License
7 stars 4 forks source link

OpenAPS devicestatus sometimes report BG level as mg/dL when using mmol/L #2

Closed bjornoleh closed 6 months ago

bjornoleh commented 6 months ago

Describe the bug OpenAPS devicestatus sometimes report BG level as mg/dL when using mmol/L.

To Reproduce Connect iAPS to NS, enable OpenAPS, hover over OpenAPS pill to see the devicestatus. Alternatively, search the NS devicestatus collection.

Usually the correct units are reported (mmol/L). But occasionally, mg/dL is reported, no clear pattern has been observed.

Expected behavior Expect BGs to be reported according to the BG unit settings in iAPS and Nightscout

Screenshots OpenAPS devicestatus pill in NS: image

Setup Information:

I have seen this for years. Can other mmol users please check if this is seen? Should be something in determine-basal.js where the devicestatus is generated

Tagging @mountrcg , although your perhaps using mgdL? I think you cleaned up some related issue in openaps/oref0?

bjornoleh commented 6 months ago

Expected units are mmol/L like here: image

mountrcg commented 6 months ago

that's quite often the case, that bg related values are reported in rT.reasons and or error logs without using convert_bg(variableName, profile) - most of my winky dinky PR's have been around those issues. I have a look

mountrcg commented 6 months ago

OK, this does not come from rT.reasonas per iAPS log

"reason": "Autosens ratio: 1, ISF: 3→3, COB: 0, Dev: 0.4, BGI: 0, CR: 10, Target: 5.5, minPredBG 7.2, minGuardBG 6.8, IOBpredBG 7.2; Eventual BG 7.2 >= 5.5, adj. req. rate: 2.1 to maxSafeBasal: 2, no temp, setting 2U/hr. ",
    "duration": 30,
    "rate": 2
}

The part with BG and TempBasal started is not prepended anythere in oref to rT.reason. So it is either iAPS NS interface or which I suspect NS itself that enriches the OpenAPS pill.

mountrcg commented 6 months ago
yep it is in NS, thats appended. Here the reason as imported in NS: imported string NS pill
Bildschirmfoto 2024-03-04 um 10 16 40 Bildschirmfoto 2024-03-04 um 10 16 30

Mind the autoISF instance, but nothing is different there from processing point of view in that regard.

bjornoleh commented 6 months ago

This was confirmed to be a NS issue, with a proposed fix here: https://github.com/nightscout/cgm-remote-monitor/pull/8234

Closing the issue 🥳