Skip to content

Carry the pump reservoir value across records that omit it - #746

Open
bjorkert wants to merge 1 commit into
devfrom
fix/pump-reservoir-dropouts
Open

Carry the pump reservoir value across records that omit it#746
bjorkert wants to merge 1 commit into
devfrom
fix/pump-reservoir-dropouts

Conversation

@bjorkert

@bjorkert bjorkert commented Sep 7, 2026

Copy link
Copy Markdown
Member

LoopFollow reads the newest Nightscout device status record and treats a missing pump.reservoir as a reservoir above 50U. That is right for a full Omnipod, but Loop also leaves the field out of many records while the pod is below 50U.

I looked at 13 days of data from two Nightscout sites. There were 28 and 40 such gaps, median 25 minutes, the longest 85 minutes, and several of them happened while the pod held between 7 and 19 units. The pump row read 50+U through all of them, and since latestPumpVolume was pinned to 50 the low reservoir alarm could not fire either.

LoopFollow now keeps the last exact reading per pump and reuses it for 30 minutes when the field is missing. Once the reading is older than that the row shows an em dash. Replaying the same 13 days, the 172 and 228 records that read 50+U while the pod was below 50U drop to none, 127 and 157 records show the real volume, and 63 and 88 show the em dash.

Loop's first records for a new pod still carry the previous pod's final volume for up to 10 minutes, so a reading from the first 15 minutes after a pump appears is not taken as evidence that the pod is below 50U.

Trio and iAPS put no pumpID, manufacturer or model in the record, and they upload the reservoir without gaps, so records with no pump identity are resolved from the record alone. I checked six Trio and iAPS sites and no record resolves differently there. A Medtrum pump on Trio reports its volume in every record and is not affected.

Pumps that do name themselves and report a volume in every record show an em dash when the field is missing, since 50+U only makes sense for a pump that reports a volume solely when it is low.

Docs for the pump row will need a note about the em dash, in a separate PR.

Loop uploads pump.reservoir in only some device status records while an
Omnipod is below 50U. The last exact reading is kept per pump and reused
for 30 minutes when the field is missing, and the pump row shows an em
dash once it is older than that.

A missing reading reads as 50+U for pumps that report a volume only when
it is low, and for records that name no pump at all, which is how Trio
and iAPS upload. Pumps that name themselves and report a volume in every
record get the em dash instead.

A reading that arrives within 15 minutes of a pump first appearing can
still be the previous pod's, so it is not taken as evidence that the pod
is below its reporting limit.

latestPumpVolume is optional so an unknown volume cannot reach the
reservoir alarm as 50.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant