Skip to content

Ignore the previous pod's reservoir volume after a pod change - #783

Merged
marionbarker merged 5 commits into
devfrom
fix/pod-change-reservoir-carryover
Oct 31, 2026
Merged

marionbarker merged 5 commits into
devfrom
fix/pod-change-reservoir-carryover

Conversation

@bjorkert

@bjorkert bjorkert commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Loop uploads its last reservoir reading until it is 15 minutes old, whichever pod it came from, so the first records after a pod change carry the old pod's final volume under the new pod's ID. Since #746 carries a reading for 30 minutes, LoopFollow showed the old pod's volume for around 45 minutes after a change, and the low reservoir alarm could act on it.

For an Omnipod, volumes after a pump ID change are now ignored and the row shows 50+U until the new pod has uploaded a record without a volume or 15 minutes have passed. A new pod reports no volume until it is below 50U, so nothing real is lost. While Loop shows a status in place of the reservoir, such as No Pod, Finish Setup, Manual Basal or Signal Loss, the Pump row shows that status, and the stored pump is kept through those records so the next pod still reads as a change. Medtrum, which Loop always reports as Unknown, still shows its volume. Reading times are the record's pump clock.

Replayed against a month of Nightscout data from one Loop user with DASH, all five pod changes with carried over volumes now show 50+U.

Loop keeps uploading its last reservoir reading for 15 minutes after a pod change, under the new pod's ID. LoopFollow now ignores volumes for a new Omnipod until it has uploaded a record without one or 15 minutes have passed, and dates readings by the record's pump clock.
@marionbarker

Copy link
Copy Markdown
Collaborator

Test

Not sure the logic on this is correct.
If there is no pod connected to the Loop phone, I don't think LoopFollow should say 50+
I think that NS doesn't show the nil until the new pod is paired

Configuration

Use an rPi for the Loop phone

Build the LoopFollow branch from this PR and configure it to follow the Loop URL.

Test Details

2026-10-29

Build a main v3.14.11 build onto the Loop phone
Configure to use a DASH pod mode for the rPi.
Check the Nightscout site - it is showing 50+ U.

19:50 NS: 0.00 U (when there was no pod); OmnipodKit shows 50+
work on other tasks
Set the reservoir value to 50.5 U and then bolus so < 50; wait for it to show up in NS
20:56 NS 49.2, Loop 49.2, LoopFollow 49

21:00 Deactivate the Pod
21:06 NS No Pod, Loop No Pod, ❌ LoopFollow 50+
21:10 Prime, pair and insert new rPi DASH pod on Loop phone
21:13 ❌ NS 0.00 U, Loop 50+, LoopFollow 50+
21:29 NS 50+, Loop 50+ LoopFollow 50+

@bjorkert

Copy link
Copy Markdown
Member Author

Thanks Marion. Agreed on 21:06: with no pod paired LoopFollow now shows "—" instead of 50+. At 21:13 the 0.00 U Nightscout shows is a value uploaded right after the pod change, and LoopFollow showing 50+ there (matching Loop) is the fix working.

@marionbarker

Copy link
Copy Markdown
Collaborator

Test

❌ When NS says: Finish Setup, LoopFollow should say "-", not "50+"

Configuration

Update to the most recent commit for the fix/pod-change-reservoir-carryover branch, 066c3a5

Test Details

2026-10-30

Loop phone is connected to an rPi DASH, showing 50+ on reservoir level

Time Loop NS LoopFollow comment
06:56 50+ 50+ 50+ ✅
06:58 Deactivate Pod
06:59 No Pod No Pod - ✅
06:59 Pair/Prime Pod
07:01 Finish Setup Finish Setup ❌ 50+ LF should indicate "-" here
07:03 Insert cannula
7:04 50+ lags
Finish Setup
N/C NS lag is not our problem
7:05 50+ 50+ 50+ ✅

@bjorkert

Copy link
Copy Markdown
Member Author

Thanks. LoopFollow now follows the status Loop uploads in place of the reservoir (reservoir_display_override), so it shows "—" whenever Nightscout shows Finish Setup, No Pod, Signal Loss, Manual Basal or a similar status.

@marionbarker

Copy link
Copy Markdown
Collaborator

Test

I know that Loop uploads Manual Basal to Nightscout. (Not something the solve with this PR).
❓ Might be better to echo: No Pod, Finish Setup, Manual Basal, Signal Loss to LoopFollow instead of using "-".
I have not tested with a Medtrum Patch yet.

Configuration

Update to the most recent commit for the fix/pod-change-reservoir-carryover branch, a9a7770
The LoopFollow phone is following a Loop URL

Test Details

2026-10-30

Loop phone is connected to an rPi DASH, showing 50+ on reservoir level

Time Loop NS LoopFollow comment
14:08 50+ 50+ 50+ ✅
14:09 Deactivate Pod
14:15 No Pod No Pod - ✅
14:15 Pair/Prime Pod
14:20 Finish Setup Finish Setup - ✅
14:20 Insert cannula
14:34 50+ 50+ 50+ ✅
14:34 Modify reservoir to be <50 so it registers
14:39 49.1 49.1 49 ✅
14:40 Set Manual Temp Basal
0.2 U/hr for 30 min
14:45 MTB (main)
Pod UI 49.1
Manual Temp Basal - ✅

marionbarker
marionbarker previously approved these changes Oct 30, 2026

@marionbarker marionbarker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve from test but not merging in case a different indication in LoopFollow is desired.

@bjorkert

Copy link
Copy Markdown
Member Author

Thanks Marion, LoopFollow now shows the status Loop uploads in place of the reservoir instead of "—" (9890778).

I tested the latest commit end to end in the simulator with real pump drivers against simulated pumps: Loop (next-dev) with OmnipodKit and a simulated DASH pod, and Trio (dev) with OmnipodKit, MedtrumKit and DanaKit against simulated DASH, Medtrum Nano and DanaRS v3 pumps. Each uploaded to a local mock Nightscout that LoopFollow on this branch followed.

Loop with DASH

CaseNightscout reservoir, statusLoopFollow
1Pod active, above 50Unone50+Uloop-01
2Pod below 50U4545Uloop-02
3Manual temp basal45, Manual BasalManual Basalloop-03
4Pod deactivated0, No Pod, pump ID UnknownNo Podloop-04
5New pod paired, cannula not inserted0, Finish Setup, new pod IDFinish Setuploop-05
6New pod active, 4 minutes after the change0 under the new pod ID (the old reading)50+Uloop-06
7New pod, 19 minutes after the changenone50+Uloop-07
8Pod out of rangenone, Signal LossSignal Lossloop-08

Case 6 is the carried over volume: Loop uploaded 0 from the No Pod record under the new pod's ID until about 15 minutes after the change, and LoopFollow showed 50+U throughout, as Loop did.

Trio with DASH, Medtrum and Dana

CaseNightscout reservoirLoopFollow
1DASH, no pod, right after switching from Medtrum200 (the Medtrum patch's last volume)200Ut01
2DASH, new pod paired, not insertednone50+Ut02
3DASH, pod below 50U4545Ut03
4DASH, pod deactivatednone50+Ut04
5Medtrum, patch active200200Ut05
6Medtrum, patch deactivated200 (the old patch's volume)200Ut06
7Dana, first record after pairing200 (the Medtrum volume again)200Ut07
8Dana, after the first sync300300Ut08

Trio uploads no pump ID, model or status in place of the reservoir, so this PR can't tell a pump change apart there, and LoopFollow shows what Trio uploads. In cases 1, 6 and 7 that is the previous pump's last volume, which Trio keeps uploading until the new pump reports one. That needs a change in Trio and is outside this PR.

@marionbarker marionbarker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by test build and spot check.

@marionbarker
marionbarker merged commit f5ad131 into dev Oct 31, 2026
2 checks passed
@marionbarker
marionbarker deleted the fix/pod-change-reservoir-carryover branch October 31, 2026 14:10
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.

2 participants