nightscout / AndroidAPS

Opensource automated insulin delivery system (closed loop)
https://wiki.aaps.app
GNU Affero General Public License v3.0
696 stars 1.7k forks source link

[DEV][Tidepool] Manual BG entries messing up stats in tidepool #2411

Closed jbr7rr closed 1 year ago

jbr7rr commented 1 year ago

Build 4e502026e0-2023.02.14 (dev-h) merged at 388ee3d56cbe3772189a5cebc53b420371525dff Pumps used: Insight, Dash and Virtual Logs: I had logging disabled at the time of enabling the Tidepool plugin. I will add logs of a manual entry upload as soon as I have logs for it (have to wait 3 hours before tidepool uploads)

When a manual BG entry is present (these are coming from xDrip in my case) in the data uploaded by AAPS, Tidepool does not handle this correctly. Example 1: Manual entry is added at 8:20 @ 3.7mmol, Tidepool counts this as a whole day below target range in the stats Screenshot from 2023-02-15 19-29-05

Example 2: Manual entries are added at: 12:30, 14:20 and 14:33 all in range, 3 days of in range is added to stats Screenshot from 2023-02-15 19-34-41

If more information is needed please let me know

jbr7rr commented 1 year ago

New entry gave problems as well: Time of manual BG entry: 15-02-2023 19:47 AndroidAPS_LOG_1676508664449.log.zip

MilosKozak commented 1 year ago

I checked Tideppol documentation and data is uploaded as requested http://developer.tidepool.org/data-model/device-data/types/cbg.html report issue to https://public-chat.tidepool.org/

gniezen commented 1 year ago

@jbr7rr Are these manual entries from a BG meter? Then AndroidAPS is uploading them as the wrong record type. They should be handled as self-monitored BG values, not CGM values: https://developer.tidepool.org/data-model/device-data/types/smbg.html .

jbr7rr commented 1 year ago

@jbr7rr Are these manual entries from a BG meter? Then AndroidAPS is uploading them as the wrong record type. They should be handled as self-monitored BG values, not CGM values: https://developer.tidepool.org/data-model/device-data/types/smbg.html .

Yes, these are manual entries from BG meter

emmatovar27 commented 1 year ago

The correct type should be "smgb" which is what tidepool docs said.

Currently, the type is "cgb" in line 24 in this file

plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt

The glucose reading looks like dots in the graph.

image

jbr7rr commented 1 year ago

@emmatovar27 Nice, will you create PR for this? Otherwise I can change and test, and create PR afterwards?

MilosKozak commented 1 year ago

updated by https://github.com/nightscout/AndroidAPS/commit/b244d174fa4fbf90835e09584078812359a8b587