-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prep for oref0 0.6.0 release dev to master #707
Conversation
Number one error for beginners that blocks looping is when people don't have the pump set to absolute u/hr (in % basal type instead), which prevents the rig from being able to set temp basals.
* echo status * try preflight twice * check radio 10x, and mmtune if all checks fail * echo Preflight when starting it * mmtune 30% of the time * it's ok if refresh_profile or refresh_pumphistory_24h fail * Revert "check radio 10x, and mmtune if all checks fail" This reverts commit 6ea8637. * remove extra any_pump_comms debugging * removing duplicate 30s wait_for_silence before mmtune * show just last line of any_pump_comms 1 output when Radio check fails * check radio thrice * echo "Done waiting for rigs with better signal." * case-insensitive grep to match 'Comms with pump detected' too * print when preflight fails * retry radio check one more time * exponential backoff on Radio check * echo -n . when retrying Radio check * print any_pump_comms output when it doesn't succeed * ignore mmeowlink-any-pump-comms.py exit code and just check output * reduce debugging
…r zombie-carb safety
…ir-own' into 0.6.0-dev
* if currentDeviation is null or maxDeviation is 0, set mealCOB to 0 for zombie-carb safety (#589) * don't SMB unless bg > threshold
* Fix require() statements to work with Node 8 * Change to determine_basal that exposes behavior changes * Oops can’t do that simplification * Fiasp curve * removed debug logging * peak configuration, support old bilinear model * Changes to code structure, more tests * Revert a require() change that was included accidentally * Another change revert, needs testing outside the scope of Fiasp * Removing accidental formatting changes * Force IOB to 0 if over 5 hours have passed. Added tests, support for Novo peak scaling. AUC normalized for activity. * Renamed the curves for consistency * Small speedup to IOB calculation, use consistent date value if missing, added default curve to profile to ensure the correct curve is used * New generic curves * Corrected error logging * simply calculate biobContrib using 2t instead of t * Fixed bolus snooze test data to match the new calculation method * unit test for COB calculation - note the math is unverified. New logic for ISF fetching. Bug fix COB calculation if only one event is presented. Sort glucose data to match later logic assumptions. * Testing if removing package-lock.json fixes the build * Testing relative require paths in case that makes the server happy, fixed formatting * Fix test name, add travis build with Node 8 * Revert "Merge branch 'cob-test' into 0.6.0-dev" This reverts commit 72a60d9, reversing changes made to 547376a. Conflicts: lib/iob/total.js * chmod +x bin/oref0_nightscout_check.py
… once (#603) * get treatments from pumphistory once, not every time we get_iob() * get treatments from pumphistory once, not every time we get_iob()
* only try to get bnep0 IP id bt-pan succeeds * disable_hotspot every 20m to check for wifi
This parameter is dangerous when used with autotune and doesn't have the expected or described results. Remove for now. (Docs will also need to be adjusted)
* print when Retrying a command * remove duplicate old function monitor_pump * don't print traceback when Couldn't refresh pumpprofile * stringify status.json * wait 15-30s for boluses to finish * install bash-completion * retry bad_wifi after an hour
* validate pumpprofile.json.new before using * fix current_basal check * don't print filename * show the right file
Rc2 Working well here 👍 |
FYI to all following this thread: we have updated to 0.6.0-rc2. Current confirmation is that Edison/EB is working ok; Pi/TI is working ok (based on rc1 feedback so far, rc2 includes minor changes. I'd like to make sure we get checks on all the sensors - I know traditional Dexcom G4 is working ok; please sign off if you're a G5 user; Medtronic CGM user; or xdrip user. Also, need someone with WW pumps confirming this is still good as well, plus confirm time zones are ok. Thanks!
|
Been working well on a WW 522 pump with G5 sensor. Also tested for just over a day with the same pump but with xdrip on a spare android phone and separate rig. |
I’m running rc2 with a G5 on the iOS app and a 523 pump. All is well. |
We have been running rc2 on 2 edison/explorer rigs, one with WW 722 and another with WW 522, both with xdrip+. No issues. |
I think there might still be an issue with MDT CGM and the |
Looks like it does cause an error for MDT CGM. Is there a way of determining which CGM device was selected inside oref-set-device-clocks.sh?
This doesn't actually stop the loop working, so not critical to fix for this release. |
Ok, let’s move the MDT CGM clock set thing to a new issue then, as it’s not a new regression and not a blocker. Should be pretty straightforward once we refactor the MDT CGM stuff into oref0-pump-loop. |
Today I entered two boluses using Easy Bolus on my 523 pump, fairly soon after a small SMB had been delivered. Both of these Easy Boluses did not appear in Nightscout. I used CarePortal to enter the two boluses into Nightscout. |
@dirkgastaldo - did the data appear in Openaps logic - coming up within the Openaps data for carbs and insulin (meaning they'd be in your database)? We periodically have instances where the data does not appear as a treatment in NS but Openaps knows about it (i.e. IOB and carbs are correct as reported by the openaps pill and logs). We have noticed this when using bolus wizard on the pump. Because we know the info has made it into the logic of Openaps, it is mostly just a nuisance that it doesn't show in NS. The communication between the pump and the rig is fine - data is read by Openaps w/o any troubles from the pump and is updated accordingly within the active looping process. In our instance, at least, the problem would seem to be on the NS side. |
👍 I'm running with g5, xdrip-js one-shot mode and 522. All is well. |
@JELCRAWFORD - I'm not sure if it was in my log. I will check next time it happens. Thank you. Makes sense. |
Running a NAM 522 & overall things are working well. I really like the new prediction lines & the decrease sensitivity while low temp as an option to drive more aggressive correction. Had an interesting scenario this afternoon, where the purple prediction lines were inverted / mislabeled. highest prediction line was IOB, middle line was COB, and the bottom line was labeled as Zero-temp. Had 3 COB, 0.49 IOB. LMK if I should report/document this elsewhere... |
They weren’t mislabeled. The COB and IOB lines are inverted like that when the absorption time for the remaining carbs is less than 1 hour, because the IOB curve always assumes current deviations will continue for an hour. UAM can be above or below any of the others, depending on the recent deviation trend. |
Thanks Scott. Perhaps some clarification would be beneficial for the Zero-temp curve as well. Based on the fact that zero-temp curve is the lowest, I assume it takes IOB into account, but not COB. |
The zero-temp scenario is that deviations will immediately revert to zero, and that a zero temp will be run until BG starts rising and is above target. If that isn’t clear yet in the 0.6.0-dev docs, please do PR to clarify. |
Note: this next release will be a big release (from 0.5.5 to 0.6.0 to match the significant changes).
WARNING: This code has many changes compared to 0.5.5. Do not implement this branch for testing unless you review the diff and plan to watch it closely. Also, do not change default behaviors of features until you test the defaults of this branch. There may be some things not yet documented here that need to be documented; please comment on this thread or in channel to help note what needs documenting. Make sure you follow this PR so you will get notifications about changes to this branch. It is still changing feature-wise, so you will want to update as new features and bug fixes are added in.
See the bottom-most comment for how to install and run 0.6.0.
CHANGED: Default behavior change for carb absorption
In 0.6.0, carb absorption now uses a
/\
shaped bilinear carb absorption model (replacing the previous---
shaped constant model for predicting the future absorption of newly entered carbs that haven't shown any effect on BG yet. As a result, the COB predBG purple prediction line immediately after entering carbs shows an S-curve shaped rise that starts out flat (in line with current BG trends), and then rises sharply after about an hour before flattening out.CHANGED: Single BG target (not range) by default
Since many people seem to set their pump's bolus wizard target range rather wide, and then ask questions about why OpenAPS isn't doing more to prevent highs and/or lows, and since most experienced users end up with a much narrower target range, usually setting the low and high targets equal (100-100 or similar), we've changed the default BG target behavior to use only a single value as target, specifically the low end of the pump's bolus wizard target range. This was done by making override_high_target_with_low the default behavior, and adding a wide_bg_target_range preference (false by default) to override that and restore the previous default behavior if someone really wants a wide target range. This also makes it possible to set the high end of the bolus wizard target range to something high (like maybe 160 mg/dL) to prevent the pump from adding on a correction bolus when entering a BG value into the bolus wizard.
Exponential Curves
The code now supports three new configuration variables in preferences.json to allow exponential curves that better reflect the effects of insulin:
In order to use the rapid-acting or ultra-rapid curves, your pump must be set to 5 hour DIA, or longer. 6 hours is recommended as the starting point.
The details of the curve calculations and discussions can be found PR #568
Enhanced SMB (eSMB)
Note: for folks with tiny basals (in this case, say <0.5u/hr), exercise even more caution, as additional tweaks may need to be made to SMB-related portions of the code.
The default behaviour for SMB is that the max bolus that can be delivered is no greater than 30 mins of basal insulin. An additional preferences value, "maxSMBBasalMinutes", has been added to allow SMB to deliver a different amount of insulin as an SMB. This gives the ability to make SMB more aggressive if you choose. As with standard SMB, it is triggered by temp targets, carb entries and a pump bolus.
Increasing "maxSMBBasalMinutes" will allow the SMB functionality to deliver more insulin, earlier in the SMB process.
"maxSMBBasalMinutes" can be added into
myopenaps/preferences.json
. It is recommended that the value is set to start at 30, in line with the default, and if you choose to increase this value, do so in no more than 15 minute increments, keeping a close eye on the effects of the changes.It is not recommended to set this value higher than 90 mins, as this may affect the ability for the algorithm to safely zero temp. It is also recommended that pushover is used when setting the value to be greater than default, so that alerts are generated for any predicted lows or highs.
Other SMB adjustments include: The preference of enabling SMB to always be on. (Leaving this as false (off) means the existing SMB toggles for carbs, temp targets, etc. will be what drives SMB behaviors.)
Also adjusted: the basal and bolus distinctions - we eliminated bolus snooze
With eSMB now allowing no-bolus operation of OpenAPS, the distinctions between manual boluses and microboluses are breaking down, which prevents things like bolus snooze, which assume that automatically administered insulin should be classified as basal insulin / IOB and kept distinct from bolus insulin / IOB. Now that carb ratios can be properly autotuned, carb absorption is assumed to occur over less than DIA, the original need for bolus snooze is largely eliminated. The only remaining need for it might be if anyone is not entering carbs (either via NS or the pump), is manually bolusing for food, and then is expecting bolus snooze to cover until UAM kicks in, but that is likely a minimal or non-existing set of people. (Please test & let us know if there are any issues). Moving forward, this removes all references to bolus snooze, bolus vs. basal insulin, and other similar now-obsolete distinctions.
Autotune adjustments
Autotune now tunes carb ratio directly, eliminating the previously known upward bias on ISF and carb ratio. This also smooths out mealtime basals based on surrounding hours when there's no data for tuning a particular hour due to meals.
Behavior change recommended as a result: You should be logging rescue carbs (carbs eaten for lows or predicted lows) so that Autotune knows about them. (Rescue carbs can be entered into Nightscout directly (i.e. NS website care portal, IFTTT buttons, etc.) or via the pump as long as they are accompanied by a 0.1 bolus. Any carb entry on the pump without a bolus is ignored by OpenAPS).
CHANGED: High temp targets and exercise mode
How temporary targets impact operation of OpenAPS in 0.6.0:
exercise_mode
when enabled means that for a target of 111 or higher will create a manual sensitivity ratio, thus adjusting ISF and basals in proportion to this adjusted target. The goal of this is to recalculate IOB down to zero sooner ahead of and during activity, when the human knows this increased sensitivity is coming.There is another variable,
half_basal_exercise_target
, for people to configure at which level they'd like basals to be at 50%.More documentation of all the new options and autosens behaviors is needed before release. The conversation at https://gitter.im/nightscout/intend-to-bolus?at=5a00e1d986d308b755b70913 is a good place to start for that.
A52 risk mitigation by disabling SMBs with Bolus Wizard
In order to cancel out of any bolus wizard or other menus before bolusing and reduce the risk of pump A52 errors, oref0 now sends ESC three times to the pump before issuing an SMB.
In addition, the recommended method for using SMBs is to enter carbs via NS and easy bolus any desired up-front insulin (generally less than the full amount that would be recommended by the bolus wizard) and then let SMB fill in the rest as it is safe to do so. For situations where the bolus wizard is preferred, such as for carb entry by inexperienced caregivers, or for offline use, we feel that it is safer for OpenAPS to disable SMBs and fall back to AMA until the next meal. In addition to reducing the risk of A52 errors, disabling SMBs when the bolus wizard is in use leads to more predictable AMA behavior (instead of SMB zero-temping) for untrained caregivers in an environment that is usually more prone to walk-away pump communication issues.
For anyone who does not wish to follow this recommendation, and wants to use the pump bolus wizard with SMB despite the increased risk of A52 errors, this change adds support for a non-displayed preference defaulting to false. Anyone who wishes to explicitly acknowledge their increased risk tolerance can add that preference, with a value of true, to retain the old behavior.
Other stuff:
carbsReqThreshold
defaults to 1. Can be added to preferences.json if you want to change it to only get carb notifications via Pushover for larger amounts.Troubleshooting
preferences.json
- if you get "Could not parse input data: {SyntaxError: Unexpected end of input]" or similar input error, double checkpreferences.json
How to install 0.6.0
0.6.0 also has support for no-git-based-flow, to reduce git-related errors for most users. This is now the default path.
Follow the dev instructions in the docs: http://openaps.readthedocs.io/en/latest/docs/Customize-Iterate/update-your-rig.html
As always, after an update/runagain, you'll also want to go in and edit your preferences as well. Check the code diff here to see what the optional preferences are for 0.6.0 - they are not in the main docs yet.
Testing list before release
Release checklist
(Help wanted beginning to take some of these PR notes and translate to the docs - see high level list in openaps/docs#1104 and please target doc PRs related to 0.6.0 features to the 0.6.0-dev-docs branch - thanks!)