{"action":"created","issue":{"url":"https://api.github.com/repos/openaps/oref0/issues/707","repository_url":"https://api.github.com/repos/openaps/oref0","labels_url":"https://api.github.com/repos/openaps/oref0/issues/707/labels{/name}","comments_url":"https://api.github.com/repos/openaps/oref0/issues/707/comments","events_url":"https://api.github.com/repos/openaps/oref0/issues/707/events","html_url":"https://github.com/openaps/oref0/pull/707","id":263750689,"number":707,"title":"Prep for eventual oref0 0.6.0 release dev to master","user":{"login":"danamlewis","id":7468165,"avatar_url":"https://avatars0.githubusercontent.com/u/7468165?v=4","gravatar_id":"","url":"https://api.github.com/users/danamlewis","html_url":"https://github.com/danamlewis","followers_url":"https://api.github.com/users/danamlewis/followers","following_url":"https://api.github.com/users/danamlewis/following{/other_user}","gists_url":"https://api.github.com/users/danamlewis/gists{/gist_id}","starred_url":"https://api.github.com/users/danamlewis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danamlewis/subscriptions","organizations_url":"https://api.github.com/users/danamlewis/orgs","repos_url":"https://api.github.com/users/danamlewis/repos","events_url":"https://api.github.com/users/danamlewis/events{/privacy}","received_events_url":"https://api.github.com/users/danamlewis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/openaps/oref0/milestones/2","html_url":"https://github.com/openaps/oref0/milestone/2","labels_url":"https://api.github.com/repos/openaps/oref0/milestones/2/labels","id":2697369,"number":2,"title":"0.6.0","description":"Next minor release for new features such as exponential-curves, nogit, and node 6+ support","creator":{"login":"scottleibrand","id":6982790,"avatar_url":"https://avatars1.githubusercontent.com/u/6982790?v=4","gravatar_id":"","url":"https://api.github.com/users/scottleibrand","html_url":"https://github.com/scottleibrand","followers_url":"https://api.github.com/users/scottleibrand/followers","following_url":"https://api.github.com/users/scottleibrand/following{/other_user}","gists_url":"https://api.github.com/users/scottleibrand/gists{/gist_id}","starred_url":"https://api.github.com/users/scottleibrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottleibrand/subscriptions","organizations_url":"https://api.github.com/users/scottleibrand/orgs","repos_url":"https://api.github.com/users/scottleibrand/repos","events_url":"https://api.github.com/users/scottleibrand/events{/privacy}","received_events_url":"https://api.github.com/users/scottleibrand/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":34,"state":"open","created_at":"2017-08-11T21:56:38Z","updated_at":"2017-11-15T01:01:41Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2017-10-08T20:50:15Z","updated_at":"2017-11-17T16:55:03Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/openaps/oref0/pulls/707","html_url":"https://github.com/openaps/oref0/pull/707","diff_url":"https://github.com/openaps/oref0/pull/707.diff","patch_url":"https://github.com/openaps/oref0/pull/707.patch"},"body":"**Note**: this next release will be a big release (from 0.5.5 to 0.6.0 to match the significant changes).\r\n\r\n**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.**\r\n\r\n**See the bottom-most comment for how to install and run 0.6.0.**\r\n\r\n### CHANGED: **Default behavior change for carb absorption**\r\nIn 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.  \r\n\r\n* A typical meal absorption time of 3h is assumed when carbs are first entered, which is then extended over time, so that oref0 gradually relies more on actual observed carb absorption as carbs are absorbed. When the carbs are first entered, remainingCATime is set to 3 hours. When 50% of carbs have absorbed, the remainder (that aren't seen to be absorbing already) are predicted to take another 4.5h. And as COB approaches zero, remainingCATime will approach 6 hours.\r\n* As in 0.5.3, any actual observed carb absorption will be predicted to continue into the future.  The predCI assumed carb absorption described above only kicks in for carbs would not be absorbed within the current carb absorption time if the current carb absorption rate decreases linearly over that time.\r\n\r\n### CHANGED: **Single BG target (not range) by default**\r\n\r\nSince 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.\r\n\r\n### **Exponential Curves**\r\nThe code now supports three new configuration variables in preferences.json to allow exponential curves that better reflect the effects of insulin:\r\n\r\n- curve, with legal values of blank, \"bilinear\", \"rapid-acting\" and \"ultra-rapid\"\r\n\r\n1. if set to \"bilinear\", OpenAPS uses the old insulin activity model\r\n2. If set to \"rapid-acting\" (now the default), the new curve model analyzed from publicly available data for Novorapid (Novolog) from Novo Nordisk is used. This curve should match well to Novorapid, Novolog, Humalog and Apidra and is set to peak at 75 minutes\r\n3. If set to \"ultra-rapid\", the new curve model analyzed from publicly available data for Fiasp from Novo Nordisk is used, set to reach activity peak at 55 minutes\r\n\r\n- insulinPeakTime, with legal values from 35 to 120. The value defines the minutes from bolus to peak. Note if you don't set it, the above mentioned peak defaults are used.\r\n- useCustomPeakTime, which must be set to \"true\" for the customized insulinPeakTime value to take effect\r\n\r\nIn 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.\r\n\r\nThe details of the curve calculations and discussions can be found PR #568 \r\n\r\n### **Enhanced SMB (eSMB)**\r\n\r\n**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.\r\n\r\nThe 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.\r\n\r\nIncreasing \"maxSMBBasalMinutes\" will allow the SMB functionality to deliver more insulin, earlier in the SMB process. \r\n\r\n\"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. \r\n\r\nIt 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.\r\n\r\n**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.)\r\n\r\n**Also adjusted: the basal and bolus distinctions - we eliminated bolus snooze**\r\nWith 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.*\r\n\r\n### Autotune adjustments\r\n\r\nAutotune 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.\r\n\r\n**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). \r\n\r\n### CHANGED: High temp targets and exercise mode\r\n\r\nHow temporary targets impact operation of OpenAPS in 0.6.0:\r\n\r\n- For SMB, a temporary target of 99 or lower can enable SMBs (when the option for SMBs from targets is turned to true). A temporary target of 101 (or higher) will disable SMBs.\r\n- A temporary target of (anything less than normal target) will trigger the traditional \"eating soon\" mode for temporary basal rates - even if target is normally 130, and ES target is set to 100, that will trigger more basal (but per above, no SMB's, since that is >99).\r\n- Historically, a high temp target solely caused the system to adjust the target and calculate behavior from there. (i.e. a normal target of 100, an 'activity mode' temp target for 2 hours of 140 means that OpenAPS would target 140 instead of 100 for those two hours, then revert upon canceling or expiration to targeting 100). Now, **`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. \r\n\r\nThere is another variable, `half_basal_exercise_target`, for people to configure at which level they'd like basals to be at 50%. \r\n\r\nMore 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.\r\n\r\n### A52 risk mitigation by disabling SMBs with Bolus Wizard\r\n\r\nIn 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.\r\n\r\nIn 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.\r\n\r\nFor 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.\r\n\r\n- Using the pump bolus wizard to enter carbs will prevent SMBs from being enabled for COB as long as those carbs are active.\r\n- Using the pump bolus wizard will prevent SMBs from being enabled for up to 6 hours by the \"after carbs\" or \"always\" preferences.\r\n- If anyone wants to get around that, they can add A52_risk_enable (with the capital A) to preferences and set it to \"true\" to acknowledge and intentionally use that approach, which we know leads to increased A52 errors.\r\n\r\n### Other stuff:\r\n\r\n- `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. \r\n- The purple lines in Nightscout have changed. We are removing aCOB (unused by everyone) and subbing in a \"zero temp\"-predBG line (ZTpredBG, etc.) showing how long it will take BG to level off at/above target if deviations suddenly cease and we run a zero temp until then. It then uses the lowest of those ZTPredBGs to ensure that we're dosing safely with UAM: if UAM predicts BG to stay high (based on deviations), but we wouldn't be able to prevent a low if those deviations suddenly stopped, we'll adjust the UAM-based insulinReq to be somewhat less aggressive. Conversely, if UAM shows BG ending up below target in 4h, but the ZTPredBGs show that we can safely zero temp and level out well above target, it will allow oref0 to be slightly more aggressive and bring BG down faster, safe in the knowledge it can zero temp if needed. **NOTE:** you will require an update to NS to view the new line. See: nightscout/cgm-remote-monitor#2919 \r\n\r\n\r\n## Troubleshooting\r\n\r\n1. Make sure you've fully installed (see next section), including remembering to re-set your preferences.\r\n2. If you're getting \"not enacted\" in Nightscout but are looping fine, update your Nightscout to the latest dev.\r\n3. **Number one error is a typo in `preferences.json`** - if you get \"Could not parse input data: {SyntaxError: Unexpected end of input]\" or similar input error, double check `preferences.json`\r\n\r\n## How to install 0.6.0 \r\n\r\n0.6.0 also has support for no-git-based-flow, to reduce git-related errors for most users. **This is now the default path.** \r\n\r\nFollow the dev instructions in the docs: http://openaps.readthedocs.io/en/latest/docs/Customize-Iterate/update-your-rig.html \r\n\r\n*As always, after an update/runagain, you'll also want to go in and [edit your preferences](http://openaps.readthedocs.io/en/latest/docs/While%20You%20Wait%20For%20Gear/preferences-and-safety-settings.html) 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.*\r\n\r\n### Testing list before release\r\n- [ ] different time zones\r\n- [ ] PI/TI stick rig\r\n- [ ] WW pumps\r\n\r\n### Release checklist\r\n- [ ] Doc changes (follow https://github.com/openaps/docs/pull/1104 for the work in progress)\r\n- [ ] Release notes\r\n\r\n(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!)"},"comment":{"url":"https://api.github.com/repos/openaps/oref0/issues/comments/345299961","html_url":"https://github.com/openaps/oref0/pull/707#issuecomment-345299961","issue_url":"https://api.github.com/repos/openaps/oref0/issues/707","id":345299961,"user":{"login":"tomasboudr","id":156123,"avatar_url":"https://avatars2.githubusercontent.com/u/156123?v=4","gravatar_id":"","url":"https://api.github.com/users/tomasboudr","html_url":"https://github.com/tomasboudr","followers_url":"https://api.github.com/users/tomasboudr/followers","following_url":"https://api.github.com/users/tomasboudr/following{/other_user}","gists_url":"https://api.github.com/users/tomasboudr/gists{/gist_id}","starred_url":"https://api.github.com/users/tomasboudr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomasboudr/subscriptions","organizations_url":"https://api.github.com/users/tomasboudr/orgs","repos_url":"https://api.github.com/users/tomasboudr/repos","events_url":"https://api.github.com/users/tomasboudr/events{/privacy}","received_events_url":"https://api.github.com/users/tomasboudr/received_events","type":"User","site_admin":false},"created_at":"2017-11-17T16:55:03Z","updated_at":"2017-11-17T16:55:03Z","author_association":"NONE","body":"@scottleibrand I understand how A52s occur. Is this \"A52 risk preference\" already in preferences.json or do I need to add a line?"}}
{"actor":{"display_login":"tomasboudr"}}