@SimonP I have not looked for such an API but i assume it must exist because that is what the unofficial apps use. The data will not be in the form of BG. It will be some sort of ISR.
Have you looked at whether these apps have an API to extract the BG from in near real time?
I don't know about Dexcom (though I will have a look) but certainly the way the unofficial apps work with the Libre devices is to either talk to them directly over Bluetooth (with someone having reverse engineered the protocol and cracked the encryption), or (for libre3 afaiu) to decompile the official app and insert some code (a jump or a library shim, I've not looked at the specifics in this case) to send a broadcast message to let other apps know the value. My point was that it would be nice for the Libre app (and indeed all apps that talk to CGM devices and pumps for that matter) to do this by default - broadcast the new blood sugar (or e.g. insulin, carbs) value so any interested apps running on my phone could accept that data and use it for whatever they want to.
I hope we might eventually get to the point where the sensors themselves (the bit stuck in your arm) acts as a Bluetooth Low Energy CGM device (for which there is a standard open profile) - this would mean any app (which you authorise) could accept data from the device (including bike computers). I assume there may still need to be an app from the OEM to adjust the conversion parameters stored in the on-your-arm bit of the system. A pipedream perhaps
😉
As for pumps, the keep track of IOB but, if by cob you mean Carbs on Board, I think that is incredibly difficult to track because different carbs are digested at different rates. How are you going to tell an app that the 50g of carbs you just consumed were full fat coke or a large slice of meat feast pizza?
The advantage of a pump is that I can chose to have all the insulin now in terms of the coke or to eek it out slowly over the next 5 hours for the pizza. But that requires my brain to work it out.
I do not have a closed loop pump but my understanding is you still have to tell it how many carbs you are going to eat and chose how you want it dispensed.
No pump I know has a form of AI to work out if what you did last time you ate the same food was right or whether it needs tweaking.
The best it can do is work out how much basal you need. But because injected insulin is very slow (even the fast ones like Fiasp) compared with what a healthy pancreas produces, it cannot react to raises in BG.
I agree this is difficult, and perhaps it won't work, but it would be nice to have the data readily available to be able to experiment and see if it could be improved. I think outright predictions (like with the weather) will be hard to impossible for long durations (hours rather than days with the weather), but for an MDI being able to be more adaptive (moving toward the way a pump works) with pre-bolus and then perhaps a couple of injections across a large meal with some analysis built in (rather than guess work or gut feel) would be within the realms of possibility. There does of come a point where one asks whether a pump would be better, I suppose that could be analysed on a cost basis/determined by how much people dislike injections
🙂
It is possible to work on something along these lines now (I've started, it's a side project, motivation is proportional to periods of poor control, so hopefully motivation remains fairly low!) as I can get real-time data from my unofficial (XDrip+) app, but what happens when a new sensor type comes out and you're moved over by NICE edict? if you've developed something that works with the previous unofficial app, you're stuck until the new device can be reverse engineered. It would be better for the data to be available from the get-go and then it's simply a case of a minor mod to get it talking to the new API.
fwiw I believe some of the newer code in AndroidAPS will accept and deal with unannounced carbs and if they are announced but the quantity is wrong, will also try to deal with that.
Looking back at what I said I certainly didn't mean to imply that it's easy with a pump, it's not, it's just different. I guess what I didn't consider was that we all have different degrees of variation in what we do and how our bodies respond, so no matter whether you're using MDI or a pump, there is more that could potentially be done to predict and advise on dosing/correction decisions.
If it didn't actually directly affect me I'd simply see this as quite an exciting and interesting area of research (it won't be perfect, but how good could be be made to be for as little effort as possible for the end user).