oref0: isfProfile in settings/profile.json is not updated when changed from multiple isf to one

I changed from multiple isf to only one. I noticed the isfProfile in settings/profile.json was still having the old multiple isf format, e.g.

 "isfProfile": {
    "units": "mg/dL",
    "user_preferred_units": "mmol/L",
    "sensitivities": [
      {
        "i": 0,
        "start": "00:00:00",
        "sensitivity": <<autotune_sens>>,
        "x": 0,
        "offset": 0,
        "endOffset": 420
      },
      {
        "i": 14,
        "start": "07:00:00",
        "sensitivity": <<old_sens2>>,
        "x": 1,
        "offset": 420
      },
      {
        "i": 36,
        "start": "18:00:00",
        "sensitivity": <<old_sens3>>,
        "x": 2,
        "offset": 1080,
        "endOffset": 1440
      }
    ],
    "first": 2
  },

The ISF profile is ok in settings/pumpprofile.json:

 "sens": <<new_sens>>,
  "isfProfile": {
    "units": "mg/dL",
    "user_preferred_units": "mmol/L",
    "sensitivities": [
      {
        "i": 0,
        "start": "00:00:00",
        "sensitivity": <<new_sens>>,
        "x": 0,
        "offset": 0,
        "endOffset": 1440
      }
    ],
    "first": 2
  },

Autotune fills in the first sensitivity entry in the settings/profile.json: e.g. <<autotune_sens>>

When I look the same applied to settings/insulin_sensitivities.json. I could fix settings/insulin_sensitivities.json with:

openaps report invoke settings/insulin_sensitivities.json

I tried to fix ithe settings/profile.json with the following set of commands:

openaps get-settings
openaps report invoke settings/insulin_sensitivities.json
openaps report invoke settings/autosens.json
openaps report invoke settings/pumpprofile.json
openaps report invoke settings/profile.json
openaps report invoke settings/insulin_sensitivities_raw.json

But it didn’t help. Can you please explain how I should fix this so that when the ISF profile is changed (even from multiple ISF to one) this is fixed automatically?

Tested with 0.6.0-dev, branch insulinPeakTime ( https://github.com/openaps/oref0/pull/695 ).

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 25 (19 by maintainers)

Most upvoted comments

@kcrcgm : just check the files mentioned above to see if they have multiple ISF’s. You can better format them, e.g. jq . settings/profile.json

@tepidjuice Pumphistory is refreshed each hour I believe and autotune files are updated at 5 past midnight.

If they still have multiple ISF’s after that time a workaround is to:

/etc/init.d/cron stop
l
(check to see pump loop has ended)
cd 
mv myopenaps myopenaps.multiple_isf
bash myopenaps.multiple_isf/oref0-runagain.sh
/etc/init.d/cron start

Note this is only a workaround, and reinstalls oref0 in a fresh directory. It will disable SMB until the next autotune run. We should find the root cause and make sure that a ISF or CR change is detected automatically.