nightscout / AndroidAPS

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

Autosense is reset (Oref1) on canceling a temp %Profile #1036

Open vanelsberg opened 2 years ago

vanelsberg commented 2 years ago

AndroidAPS 2.8.2.14-dev (and earlier commits) Build: d7a4740e7 Flavor: Fullrelease

Problem description: Autosense is reset on canceling a %Profile (Oref1)

Actual the "problem" is that there is no way to cancel a temp profile? Only way is setting a 100% profile "without duration". But by ORef1 definition this resets autosense.

Additional information

Running AAPS latest dev builds, Oref1, OpenAPS SMB, with Autosense and UAM enabled in settings.

Note: autosense it not reset when using 'Sensitivity WeightedAvarage'.

Repro: Configuration: Sensitivity Oref1, OpenAPS SMB with autosense and UAM enabled.

  1. Confirm autosense is active, showing a value other the "100%" on overview with ratioLimit:" like ""
  2. Set a profile of 110% for 10 minutes.
  3. When the temp profile ends, confirm autosense is still active.
  4. Set a profile of 110% for 15 minutes or more.
  5. After about 10 minutes "cancel" the temp profile by setting a 100% profile with no duration.
  6. Confirm autosense was reset: showing a value of "100%" on overview and changed to ratioLimit: "XX of 48 values").

Autosense will activate again sometime after Autosense data ratioLimit: "(XX of 48 values") changes to ratioLimit: "" This may take 8 hours or more.

Log files: AndroidAPS_LOG_1638697480059.log.zip

Screenshots Screenshot show as described under "Repro":

Screenshot_20211205-114731_AndroidAPS end when duration is passed, second temp profile switch was canceled setting a 100% profile with no duration. InkedScreenshot_20211205-104131_AndroidAPS-3 Screenshot_20211205-102243_AndroidAPS Screenshot_20211205-102729_AndroidAPS

MilosKozak commented 2 years ago

yes this is by definition

vanelsberg commented 2 years ago

Then how does user cancel a temp %Profile? :-|

Do agree that changing profile, switching profile e.g. setting a temp profile without duration by definition resets autosense. Also agree that cancelling with 100% profile with no duration is not actually a "cancel" and as such by definition also resets autosense.

So conclusion would be:

@MilosKozak Proposing a feature request: Allow user to cancel a running %Profile? (without autosense resetting) Imho, technically speaking, if a timer event can prematurely end a running temp profile, so could a user initiated event. Unfortunately such option is missing for current AAPS.

If this makes any sense to you I'll post this as a feature request / enhancement?

vanelsberg commented 2 years ago

My final conclusion, when on ORef autosense, by definition:

AAPS is missing the option for user to prematurely end a running temp profile.

chrisbev commented 2 years ago

I appreciate the need to reset on pump site change as history could be way off but for profile change what is the rational? I have wondered before the resetting if say I have AS at 120% (profile at 100%) and do a switch to 120% does AS settle at 120% or 100%? (No other changes and can't test as my body is not that consistent!). I have asked this months ago but had no replies (fb and discord). Depending on the answer then why not make the algorithm just carry on and compensate for the PS and no need to reset unless there is another need to reset that I am not aware of? After all it is just insulin doesn't matter if it from a basal profile or a bolus? If I am way off please disregard....

kristinsmotz commented 2 years ago

I would also like a good option to cancel a temporary profile change. Currently using a "workaround" to keep autosens by setting a new temp profile change at 100% with a duration slightly longer than current running temp profile. But then that one is never cancelled, just keeps counting end time in negative numbers until next profile change (temp or permanent). Seems the system won't process ending a temp profile if it is identical to the last permanent profile change.