pazaan / 600SeriesAndroidUploader

Your Medtronic 600-series pump data, direct to Nightscout
http://pazaan.github.io/600SeriesAndroidUploader/
MIT License
189 stars 312 forks source link

'insulin' for square bolus not shown in Nightscout #231

Closed hartlijn closed 6 years ago

hartlijn commented 6 years ago

See screenshot. When giving a square bolus or a combo bolus, the 'insulin' of the square bolus is not shown in Nightscout with a low IOB as result.

image

Expected: When giving a square bolus the 'insulin' is provided to Nightscout including it's duration. When giving a combo bolus, maybe the message should be split in to (one for the square and another one for the normal bolus)

uploader version 0.6.1 nightscout version 0.10.3

Pogman commented 6 years ago

In NS terms a combo bolus is a immediate bolus (IOB) and a extended basal increase.

NS knows noting about Medtronics 'square' and thus this type of bolus will only reflect the combo extended amount as there is no immediate bolus.

hartlijn commented 6 years ago

thanks for explaining. then the issue would be:

square bolus should be sent to Nightscout as tempbasal.

Now for this bolus of 1.7U zero insulin comes in Nightscout. Not as a normal bolus nor as a tempbasal. Square Bolus: 1.7U, duration 30 minutes : carb 17g 2.0U, {4.5~6.0} -0.3U, iob 0.9 0.0U (9g/u, isf 2.7/u)

IMO: You can't ignore the insulin given as a square, because Nightscout doesn't support square bolus. It does register the carbs, but no insulin. Effecting reports, autotune, but most import loop apps like AndroidAPS. AndroidAPS sees carbs without insuline and suggests incorrectly to raise the basal.

hartlijn commented 6 years ago

Strange thing is: I do see it in the graph, but in the reports the 'insulin' field is empty image

Treatment: image

@Pogman or @pazaan is there a way to read what exactly the uploader sends to Nightscout? I like to know where in the chain my 'insulin got lost'. uploader -> Nightscout -> AndroidAPS.

Pogman commented 6 years ago

The pump can be doing a square and temp simultaneously and must be handled separately. The IOB in NS is the IOB value taken from the pump.

Does AndroidAPS deal with combo bolus types? If it does it should understand the extended part even when there is no upfront insulin.

You can see the treatment entries as sent to NS in your mLab db.

hartlijn commented 6 years ago

@Pogman you are right; they should not be logged as tempbasal. AndroidAPS uses ExtendedBolus for this.

In mlab this is the treatment. How can I trace if this was provided by 600seriesUploader or by XXX (manually in Nightschout or AndroidAPS)? Is this the format the uploader uses? -->

{ "_id": { "$oid": "5b7a8fe13d9b8e16f59cf3a3" }, "carbs": 47, "created_at": "2018-08-20T11:51:28+02:00", "duration": 30, "enteredinsulin": "5.8", "eventType": "Combo Bolus", "key600": "BOLUS85758357", "notes": "Square Bolus: 5.8U, duration 30 minutes : carb 47g 5.8U, {4.5~6.0} 0.0U, iob 0.2 0.0U (8g/u, isf 2.7/u)", "relative": 2, "splitExt": "100", "splitNow": "0" }

If so, it seems ok from this side and might be an issue on Nightscout/AndroidAPS side. Nightscout should IMO in some way take this insulin into account in reporting and not only graphically.. AndroidAPS should read the combo bolus as a Normal + ExtendedBolus.

Pogman commented 6 years ago

That's the correct combo entry sent and the "enteredinsulin" field is the full programmed amount. The "key600" field is unique to the uploader.

BTW there is a bug in v0.6.1 that's fixed for the next version #203 that relates to the "relative" field part of the combo treatment and that may be causing an issue for aps users.

hartlijn commented 6 years ago

thank you - I created an issue at AndroidAPS. sometimes a little struggle to pinpoint the location in the chain (uploader, NS, or AAPS) of information where things get interpretated :)