tconnectsync icon indicating copy to clipboard operation
tconnectsync copied to clipboard

Possibility to sync blood sugar data as well?

Open JasonJShuler opened this issue 2 years ago • 4 comments

Hello! Thanks for this tool, its pretty awesome!

I was just wondering - Is it possible to also sync the blood sugar data, and calibrations?

I enter my calibrations on the pump, and they don't seem to show up in the Dexcom data - only t:connect.

If the data is available, could you point me in the right direction and I could try to do it myself?

Thanks!

JasonJShuler avatar Oct 07 '21 15:10 JasonJShuler

Adding this functionality to be synchronized would definitely be possible, as BG data (CGM and manually-entered) is exposed via the API!

The tconnectws2 therapytimeline2csv endpoint returns blood sugar reading data from t:connect. The existing WS2Api#therapy_timeline_csv() method returns a readingData key which should contain a list of Python dicts containing the available BG data: https://github.com/jwoglom/tconnectsync/blob/master/tconnectsync/api/ws2.py#L63

IIRC, there is a field inside there that denotes whether the reading is from a manually entered BG (from the bolus screen) or CGM. If you're referring to G5/G6 calibrations I'm unsure where those go exactly, I suspect they'd be included here however (I have a G6 and don't need to calibrate).

We should add whether to upload BG data to Nightscout behind a flag, since many folks (myself included) already use xDrip to sync CGM data into Nightscout and/or already input manual BG/calibration data in xDrip or nightscout directly.

jwoglom avatar Oct 07 '21 15:10 jwoglom

Thanks for following up!

I also have G6, but I got a box of bad sensors - two in a row from the same box (in very different sites) have been providing dangerously terrible data to the pump, and the pump has been trying to kill me as a result LOL. Since I just got a replacement two days ago, I suspect they will want more proof this time... so removed xDrip, installed the Dexcom app thinking they could look in clarity, but as I mentioned, Dexcom only sees calibrations entered in their app.

So yes my use case is very atypical ATM 😝 I agree about the flag - most people already have the sugar from other sources. Whenever Tandem fixes the constant t:connect logout issue on android... if this ran every minute (or 30 seconds if you wanted to go all Nyquist on it LOL) theoretically it could be a single source for all the data... sure seems cleaner in my mind!

That is, t:Connect -> Nightscout -> xDrip et al... I know Nightscout is designed to aggregate sources and everything, but something about a single stream is very appealing to me 😁

Thanks again, hopefully I can find some time to have a look

JasonJShuler avatar Oct 07 '21 17:10 JasonJShuler

Whenever Tandem fixes the constant t:connect logout issue on android...

This is so irritating. And you can't even downgrade to an older version of the app to try and resolve it since login is broken on version < 1.5 🙃

Not sure how much hope I should put into their upcoming phone bolus implementation being good if they can't even get login sessions right...

jwoglom avatar Oct 07 '21 17:10 jwoglom

@JasonJShuler Please take a look at in-progress: support BOLUS_BG and CGM features which provides an initial implementation for this feature, specifically via two "synchronization features" (BOLUS_BG and CGM). More details are in the commit description.

You can try this out by setting ENABLE_TESTING_MODES=true and running tconnectsync with e.g. --features BASAL BOLUS IOB BOLUS_BG CGM. Just be warned, there are likely bugs.

jwoglom avatar Oct 24 '21 04:10 jwoglom