Artificial-Pancreas / iAPS

MIT License
176 stars 720 forks source link

Using Apple Health / Watch exercise information for Basal/Bolus prediction #211

Closed degola closed 11 months ago

degola commented 1 year ago

It would be great if the exercise records in Apple Health, in my case coming from the Apple Watch, could be automatically used for auto-tune basal and bolus as well as food bolus calculations.

In my case my blood glucose seems to start dropping ~15 minutes after starting exercising and continues to do so for an hour after exercising while I can use the higher temp target setting I tend to forget setting it regularly so taking it automatically from my Apple Watch (which detects starting to exercise automatically + intensity even at some point) would be great.

Happy to contribute code as well but unfamiliar with the source code and lack of time, if there is somewhere an high-level code architecture available that would be great :-).

p.s.: the discord link is broken/outdated in the README.md

avouspierre commented 1 year ago

You can use shortcuts to do this. Create a shortcut with an automation on fitness workout and apply a temporal profile. A example in the screenshots

image

image

LiroyvH commented 1 year ago

@avouspierre That's pretty cool! I didn't even know it was compatible with the Shortcuts app. Question: in your example, am I correct in understanding that it won't switch to temporary profile when BG is over 180?

-edit- Yes, I see that's the case indeed - condition for 180. That's nice! I see it's also possible to make a nested IF through the ELSE. (Although it'd be way easier if Apple had added an "AND" condition, but oh well.). However, I run in to a problem there: it looks like it's not possible to check for a (temporary) active profile. Will log a feature request. Thank you!

jmatheson commented 1 year ago

Any plans for a way to set a profile via shortcuts? Temp target is nice but profile would be 💰

LiroyvH commented 11 months ago

@jmatheson I don't think there are plans perse yet, no concrete anyway, but I did make a feature request: https://github.com/Artificial-Pancreas/iAPS/issues/255

sethgagnon commented 11 months ago

Closing this issue as the shortcut instructions are mentioned above