Skip to content

Add insulin activity graph and IOB forecast - #798

Open
bjorkert wants to merge 6 commits into
devfrom
feature/insulin-activity-graph
Open

bjorkert wants to merge 6 commits into
devfrom
feature/insulin-activity-graph

Conversation

@bjorkert

@bjorkert bjorkert commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Graph settings gets an optional insulin activity graph next to the IOB graph. It shows in U/h how much insulin is acting, which starts at zero after a bolus and peaks later, while IOB jumps up right away. Like IOB it is relative to the scheduled basal, so it goes negative when less than the scheduled basal has been delivered. In the main graph negative activity is drawn upward in brown, the same way negative IOB is drawn in pink.

For OpenAPS and Trio the values come from openaps.iob.activity in devicestatus. Loop does not upload insulin activity, so for Loop LoopFollow computes it from the boluses and temp basals in Nightscout with an insulin model chosen in graph settings. There is also an Ins. Activity info row with coloring like IOB, which shows on the watch as well.

The IOB and insulin activity graphs also get a dashed forecast for the insulin already delivered and the running temp basal until it ends, as far as Hours of Prediction. For Loop it is computed the same way, and for Trio it is read from openaps.iobForecast, which nightscout/Trio#1689 adds.

Trio data with separate graphs, the curves in the main graph with negative IOB and activity, and the insulin model setting with Loop (mock data):

pr-panes pr-main pr-settings

Graphs the activity value OpenAPS and Trio upload with IOB in devicestatus, in U/h, as a history pane next to IOB. The value is net of the scheduled basal, like IOB.
Trio's activity value is shown as an info row, also at a scrubbed time. Loop does not upload insulin activity, so LoopFollow computes it from the boluses and temp basals in Nightscout, net of the scheduled basal scaled by active overrides, with the insulin model selected in the graph settings.
The row takes threshold coloring like IOB, carries its value to the watch's info page with the other rows, and shows one decimal under the name Ins. Activity so it fits on one line.
The IOB and insulin activity graphs continue dashed into the future for the insulin already delivered and the running temp basal until it ends, up to the Hours of Prediction. OpenAPS/Trio provide it as openaps.iobForecast; for Loop it is computed with the selected insulin model.
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