These are chat archives for nightscout/intend-to-bolus

1st
Aug 2016
John Dodds
@johners97
Aug 01 2016 00:00
last thing, how can I back up all my my_openaps on github (my account)
Been trying to do that for days
Ben West
@bewest
Aug 01 2016 00:00
git remote -v
did you create a repo on github site?
Think this is a rep
repo
hm
Oh and thanks, i would not have done this without you (or thingy
Ben West
@bewest
Aug 01 2016 00:02
what happens when you ssh git@github.com
John Dodds
@johners97
Aug 01 2016 00:03
c
Ben West
@bewest
Aug 01 2016 00:03
or ssh-add -l
John Dodds
@johners97
Aug 01 2016 00:03
pi@john:~/my_openaps $ ssh git@github.com Permission denied (publickey).

pi@john:~/my_openaps $ ssh-add -l
Could not open a connection to your authentication agent.
Ben West
@bewest
Aug 01 2016 00:04
hmm
there's a way to do this without passwords
but for now
git remote add origin https://github.com/johners97/OpenAPS.git
I think git push -u origin master will ask for your username and password on github
John Dodds
@johners97
Aug 01 2016 00:06
It worked!
Now, how do I retrieve it all in one go in another raspberry pi (for backup)
Incase i ever need to
Ben West
@bewest
Aug 01 2016 00:07
same git remote add ...
actually
just git clone https://github.com/johners97/OpenAPS.git
that's it
John Dodds
@johners97
Aug 01 2016 00:07
yay
Ben West
@bewest
Aug 01 2016 00:07
but it doesn't have all the device definitions
that's why I recommend that other backup technique, the oref0 export-loop my-backup.json
later you can do openaps import my-backup.json which depending on what you're trying to do is probably what you actually want
John Dodds
@johners97
Aug 01 2016 00:08
Oh yeah, I was wondering, how can I set my maximum basal rate for oref0 to set down or up? I know i might have to update oref0 ?
Ben West
@bewest
Aug 01 2016 00:08
notice, when you type git status it says all the device ini files are untracked
that's a security thing, because pump.ini has your serial in it, ns.ini has your api-secret, etc...
John Dodds
@johners97
Aug 01 2016 00:09
Yeah I see
Ben West
@bewest
Aug 01 2016 00:10
but oref0 export-loop saves all that data
then openaps import restores it all
John Dodds
@johners97
Aug 01 2016 00:10
If I fork oref0 dev, then edit some of the code, will I be able to change max basal rate?
or will that mess things up
Ben West
@bewest
Aug 01 2016 00:11
you're trying to modify max basal rate?
John Dodds
@johners97
Aug 01 2016 00:11
yes
I would like to
Ben West
@bewest
Aug 01 2016 00:12
I think it's sensitive to a field in the max-iob.json file
John Dodds
@johners97
Aug 01 2016 00:12
I notice openaps/oref0 only allows 4u/h or something
cant remember off top of my head
r$ oref0 get-profile -h
/usr/local/bin/oref0-get-profile pump_settings.json
bg_targets.json insulin_sensitivities.json
basal_profile.json [preferences.json]
[<carb_ratios.json>] [<temptargets.json>] [--model
model.json]

Options:
  --model, -m          Pump model response
                                    [default: false]
  --help               Show help           [boolean]
  --exportDefaults     Show default preference
                       values       [default: false]
  --updatePreferences  Check for any keys missing
                       from current prefs and add
                       from defaults[default: false]

Unknown argument: h
bewest@bewest-MacBookPro:~/Documents/foobar$ oref0 get-profile --exportDefaults
{
        "max_iob": 0,
        "type": "current",
        "max_daily_safety_multiplier": 3,
        "current_basal_safety_multiplier": 4,
        "autosens_max": 1.5,
        "autosens_min": 0.7,
        "autosens_adjust_targets": true,
        "override_high_target_with_low": false
}
it's not hardcoded, it's dynamically mapped through one of those settings
John Dodds
@johners97
Aug 01 2016 00:18
So they are defaults^
max_iob etc
but they are not activated
Ben West
@bewest
Aug 01 2016 00:18
those are the defaults, if you put them in max-iob.json you can customize them
the contents of max-iob.json will override these
John Dodds
@johners97
Aug 01 2016 00:19
so basal_safety multiplyer is hourly rate maxmimum?
Chris Oattes
@cjo20
Aug 01 2016 00:19
@johners97 Why do you want to increase it?
Ben West
@bewest
Aug 01 2016 00:19
you can literally copy-paste the entire thing and put it in max-iob.json and then customize it
increasing it does seem kind of odd, I noticed your max basal was 35U? this also seems very high, mine is max of 8 or so It hink
John Dodds
@johners97
Aug 01 2016 00:20
Is it?
Ben West
@bewest
Aug 01 2016 00:20
my max iob is 4 or 5, in general we're hoping to make lots of small nudges rather than big interventions
Chris Oattes
@cjo20
Aug 01 2016 00:20
@johners97 I very strongly suggest you get to grips with what your loop does first, and then spend some time running with a max_iob of 0 (i.e. low glucose suspend mode)
John Dodds
@johners97
Aug 01 2016 00:20
I was going to put it up to 5.5
@cjo20 Ok
Evenings hit me hard (insulin sensitivity plummets)
think it has something to do with our body preparing to sleep or something
Chris Oattes
@cjo20
Aug 01 2016 00:22
Your pump maximum basal rate is set to 35u. Your highest basal rate during the day is 1.4u/hr
There isn't really a good reason to have your maxmum basal rate in the pump set that high if your highest basal rate set is 1.4u/hr
Ben West
@bewest
Aug 01 2016 00:23
yeah, I noticed that as well
John Dodds
@johners97
Aug 01 2016 00:24
I don't know why it's that high, maybe when I was editing basal settings a while ago I accidentally set it to that? Putting it back down nonetheless
Ben West
@bewest
Aug 01 2016 00:24
mine is 5
Chris Oattes
@cjo20
Aug 01 2016 00:24
Mine is 1.8
John Dodds
@johners97
Aug 01 2016 00:24
going to check my max bolus as well
Ben West
@bewest
Aug 01 2016 00:25
would be very interesting to survey (automatically, please)
John Dodds
@johners97
Aug 01 2016 00:25
yeah max bolus is set to over 30, when I rarely do a bolus of over 18
getting my notepad out, going to go into the start of this conversation and understand everything!
Ben West
@bewest
Aug 01 2016 00:28
there's an intro section to how the tools themselves work, although it's pretty terse it covers the relationships between report and use and everything else http://openaps.readthedocs.io/en/latest/docs/openaps-guide/overview.html#what-is-an-artificial-pancreas
it was meant to be done interactively, in an "junk" or temporary area just to learn how the tools work together
John Dodds
@johners97
Aug 01 2016 00:30
Would be interesting to export data into excel, do you do that?
Just to plot graphs
Ben West
@bewest
Aug 01 2016 00:30
you can do that with NS api
John Dodds
@johners97
Aug 01 2016 00:31
and investigate, maybe create a postulate, an equation to predict blood glucose under certain conditions
NS api? I will investigate that
Ben West
@bewest
Aug 01 2016 00:31
your site/api/v1/entries.csv can be imported directly into excel
you can see the data: openaps use ns shell get entries.csv count=10
John Dodds
@johners97
Aug 01 2016 00:32
returned this Cannot GET /api/v1/entires.csv
oh
api
Ben West
@bewest
Aug 01 2016 00:32
sans typos
John Dodds
@johners97
Aug 01 2016 00:32
entries*?
Well, i am thinking of increasing the number of hours to fetch pump history (or n) because I can be away from internet for up to 9 hours/day
12 hours even
Ben West
@bewest
Aug 01 2016 00:38
I do this:
openaps report show --cli raw-pump/pump-history-raw.json 
openaps use pump iter_pump_hours 8.0
but you can play around with it and see how it performs
John Dodds
@johners97
Aug 01 2016 00:41
Set it to 18 hours
hopefully that comes with no implications
Kim St. Dennis
@kimstdennis_twitter
Aug 01 2016 02:52
@bewest ever run into issues with the TI stick not picking up the correct freq for the pump?
I just get defaults with mmtune.
Ben West
@bewest
Aug 01 2016 03:49
are you having trouble getting reliable communications working?
Thacher
@thacherT1D
Aug 01 2016 03:51
question for the group... those who switched from other pumps... where can I find/buy infusion sets? Getting ready to test and I want to have a few days just using the minimed pump while I'm working on the rest of the build (I'm still on an Rx for omnipod, so I can't get a Rx for them)
Martin Haeberli
@mhaeberli
Aug 01 2016 04:28
@bewest - tryng to fake oref0 sgvs with a report from ns - but this didn’t work:
openaps report add last_four_cgm_hours.json JSON ns shell get entries/sgv.json 'count=300&find[device]=share2'
Kim St. Dennis
@kimstdennis_twitter
Aug 01 2016 04:35
@bewest yes Sir.
was asking the group about it before and got good feedback but nothing the got it working from here or mmeowlink gitter.
"setFreq": 916.63,
  "usedDefault": true
@bewest ^ is what I'm ggeting
I actually had reliable comms for a while and it randomly up and quit on me.
Ben West
@bewest
Aug 01 2016 06:18
@mhaeberli should work with output from ns shell oref0_glucose tz count=10 or similar
the entries/sgv data is just fine
it's the treatments/pump-history that is different
Martin Haeberli
@mhaeberli
Aug 01 2016 06:19
K thx I'll give it a shot in the AM
Kate Farnsworth
@ELUTE
Aug 01 2016 11:36
Tackling openAPS while my daughter is away at camp. Anything you wish you knew before you started?
John Dodds
@johners97
Aug 01 2016 12:34
Blood Sugar 99% in range ;) as of 13:34
One pesky low nudged that figure down
Dave Ewall
@daveewall
Aug 01 2016 13:08
blob
Can anybody tell me why the device is zero temping so often after a bolus, causing a rise in sugars an hour later?
Is there something wrong in my settings for something, making it think that I've given myself too much, so it tries to compensate? Or is this a bug of some sort?
From the purple line, it thinks I'm going to go back down, but it takes much longer to go back to normal than it thinks I will.
Chris Oattes
@cjo20
Aug 01 2016 13:31
@daveewall It's hard to tell from that time scale, but I'd guess it's because your blood sugar was on the way down before you ate
Dana Lewis
@danamlewis
Aug 01 2016 14:13
@daveewall can you paste the log so we can see the decision making from that time? It should tell us the rationale
Dana Lewis
@danamlewis
Aug 01 2016 14:24
@ELUTE most of what I tell people is probably stuff you inherently know from NS experience.. :)
Hichame Yessou
@hichameyessou
Aug 01 2016 15:09
What is the difference between of the reports, for example, "bg_targets.json" and "bg_targets_raw.json"? Just a different name in the documentation, or a cleaned version of the data?
Brandon Faloona
@bfaloona
Aug 01 2016 15:28
Good morning everyone!
I'm trying to troubleshoot a problem where the Basal IOB is incorrect, but I'm not even sure where to start. What is the rough calculation it uses? Over what period of time?
It is showing a value that is too high, and I'm not sure why.
Chris Oattes
@cjo20
Aug 01 2016 15:32
How much too high? What is your bsal profile like over the last few hours?
Brandon Faloona
@bfaloona
Aug 01 2016 15:32
@hichameyessou All of my 'raw' reports represent data that needs another cleaning or transform step.
Dana Lewis
@danamlewis
Aug 01 2016 15:35
@bfaloona “basal iob is incorrect”: do you mean in OpenAPS (in your logs), or displayed somewhere in Nightscout?
Brandon Faloona
@bfaloona
Aug 01 2016 15:35
@cjo20 I'm guessing it should be slightly negative (because temp basals have not been over basal profile, only under current profile). It show 1.1U. Current profile is 0.6U
Chris Oattes
@cjo20
Aug 01 2016 15:36
bfaloona: how long has it been 0.6U for? What was it before?
Brandon Faloona
@bfaloona
Aug 01 2016 15:36
I'm referring to the Basal IOB value displayed in the text popup of the IOB nightscout 'pill'. I assume that comes directly from my openaps iob.json
Profile Basal rate has been at or below 0.675U since 3 am. Temp basals were much higher (3.2U) between 11pm and 2am
Chris Oattes
@cjo20
Aug 01 2016 15:39
Can you just post your basal profile json?
Brandon Faloona
@bfaloona
Aug 01 2016 15:40
$ cat oref0-monitor/iob.json {"iob":1.435,"activity":0.0032,"bolussnooze":0,"basaliob":1.435,"netbasalinsulin":1.5,"hightempinsulin":1.5}
Is that what you meant?
Chris Oattes
@cjo20
Aug 01 2016 15:40
no, basal profile, not iob
Brandon Faloona
@bfaloona
Aug 01 2016 15:41
cat settings/basal_profile.json [ { "i": 0, "start": "00:00:00", "rate": 0.7250000000000001, "minutes": 0 }, { "i": 1, "start": "03:00:00", "rate": 0.7000000000000001, "minutes": 180 }, { "i": 2, "start": "08:00:00", "rate": 0.8500000000000001, "minutes": 480 } ]
Chris Oattes
@cjo20
Aug 01 2016 15:42
What time is it now?
Brandon Faloona
@bfaloona
Aug 01 2016 15:43
8:42am
I'm not sure why the first basal profile has 0 minutes.
brb
Chris Oattes
@cjo20
Aug 01 2016 15:45
Not sure why that's showing up as positive then. There is an issue with IOB rate calcuation, but that should make it show up as less IOB present in this case
John Dodds
@johners97
Aug 01 2016 15:46
Don't all basal profiles start at 0:00 ?
Chris Oattes
@cjo20
Aug 01 2016 15:47
@bfaloona looks like 'minutes' is 'how many minutes in to the day does this rate start'
Brandon Faloona
@bfaloona
Aug 01 2016 15:49
Ok, 0 minutes at midnight. Right.
@cjo20 @danamlewis How would you suggest I troubleshoot this?
Eric Jensen
@elnjensen
Aug 01 2016 15:51

I started the walkthrough last week and was able to get my G4 receiver talking to the raspberry pi with no problem. But I just upgraded to G5, and so I'm trying to get that working now. I did openaps use cgm config --G5 and now my cgm.ini shows
[device "cgm"] model = G5
But when I try to test with openaps use cgm iter_glucose 2 I get a traceback ending with

  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/vendors/dexcom.py", line 297, in main
    for item in self.dexcom.iter_records(self.RECORD_TYPE):
AttributeError: 'NoneType' object has no attribute 'iter_records'

Does this mean it's not seeing the receiver at all? Any way to look in /dev or /var/log/messages to see what USB devices it is detecting? Or is this something else?

Brandon Faloona
@bfaloona
Aug 01 2016 16:20
@cjo20 I noticed basal_profile.json is out of date, but selelcted-basal-profile.json is correct. Looks like I removed the former from the loop.
Should selected-basal-profile.json pull from basal_profile.json? I don't see it referenced in the selected-basal-profile.json report. Is the dependency implicit? Here's my selected basal profile report, in case it's the problem:
$ openaps report show --ini settings/selected-basal-profile.json 
[report "settings/selected-basal-profile.json"]
device = oref0
remainder = copy-fresher raw-pump/selected-basal-profile.json
use = shell
json_default = True
reporter = JSON
This message was deleted
Eric Jensen
@elnjensen
Aug 01 2016 16:57
Ignore my previous message above for now - looks like my Mac can't see Dexcom receiver when plugged in via USB either - so not an OpenAPS problem. Looking into it...
Eric Jensen
@elnjensen
Aug 01 2016 17:11
OK - swapped cables and it works fine now. Interesting - brand new cable I tried first works fine for charging but won't transmit data.
Hmm, this line in the walkthrough:
openaps use cgm oref0_glucose --no-raw --hours 2.0
returns an empty record: []. No error, but no data. Using iter_glucose works fine.
Dave Ewall
@daveewall
Aug 01 2016 18:21
@cjo20 @danamlewis Here's the reasoning from this morning when it set the zero temp. Looks like it thinks I'm going to go low, even though I didn't (although maybe I was heading there at the time?), but this seems to happen a lot to me. Curious what you think.
blob
Unfortunately, duty calls... bbl.
Scott Leibrand
@scottleibrand
Aug 01 2016 18:47
@daveewall are you running AMA on the dev branch of oref0, or the old meal assist from master?
Brandon Faloona
@bfaloona
Aug 01 2016 19:42
I assume the Eventual BG calculation depends on IOB being correct. What time frame does it use? or stated another way, When does it think the BG will reach this value?
I'm adding a bunch of terms I'm curious about to the OpenAPS docs Glossary. Is that the right location?
I'm adding terms like: Eventual BG, Basal IOB, Net IOB, OpenAPS status messages displayed in nightscout: waiting, enacted, unknown, ....
Ben West
@bewest
Aug 01 2016 20:01
yes
that's encouraged :-)
Brandon Faloona
@bfaloona
Aug 01 2016 20:16
Great!
Would it be appropriate to add a terse loop section to this page? http://openaps.readthedocs.io/en/dev/docs/openaps-guide/overview.html
Even a terse mention of cron at that point might help demystify how data flows in the system.
Ben West
@bewest
Aug 01 2016 20:33
there's a section somewhere that recommends using oref0 cron-5-minute-helper
if you think it could expansion or should be re-organized/clarified somewhere, that sounds like a reasonable proposal
can customize the template a bit with arguments: oref0 cron-5-minute-helper openaps loop changes the default template
hmm, ah you mean introducing concept of cron in there
that sounds interesting too
Ben West
@bewest
Aug 01 2016 20:39
yeah, that section is meant to kind of step back from "looping" as a concept for a kind of big picture overview of here's a bunch of tools and it might be a good idea to learn how they work (outside of creating/maintaining a loop)
John Dodds
@johners97
Aug 01 2016 20:47
Hi, I would like to add a feature to make the openaps be "unable" to issue a temporary basal rate of less than 0.200 units/hour after carbohydrate consumption; and between the times 18:00 and 22:30
upto 40 mins after carb consumption
unless recovering from a hypo of less than 3.5
I am learning js and python atm, so don't tell me how to do it. I'm just wondering if anyone has done anything similar?
Dana Lewis
@danamlewis
Aug 01 2016 20:51
@johners97 have you taken a look at AMA (advanced meal assist)?
Ben West
@bewest
Aug 01 2016 20:52
it'd be js stuff in determine-basal, part of oref0, perhaps some of the associated ama tools can help, also part of oref0 in js
John Dodds
@johners97
Aug 01 2016 20:54
yeah i've looked at ama. at this stage i need to start learning to program - js and python are my choices. i looked at some of code in oref0 and see that its js. I have some other ideas so in the next few weeks i might yield some results
Ben West
@bewest
Aug 01 2016 20:57
the part that ultimately decides the amount of temp basal is determine-basal in js :-)
Dana Lewis
@danamlewis
Aug 01 2016 20:59
@johners97 k. so take a look in there for an example of the closest logic to what you’re looking for if you want to modify the algorithm further to your individual specifications.
John Dodds
@johners97
Aug 01 2016 21:03
reading some journals as well. I notice when humans smell food they secrete more insulin. been determining the average times I have meals and could code somthing ;; if probability of eating a meal at "t" time > 0.85 then increase temp basal by x amount. Could take a 3 week average of CGM/carbs to refresh the probabilities? Could be useful for people who plan their meals to eat at certain times. a safety net could be added, so if rate of change of BG is negative at given time when probabillity > 0.85 then do not enact new basal rate. Human behaviour is complex, unpredictable, but we can say for certain "in 24 hours the chances of eating are 99%" (for me anyway). To further explore, the pi could attach a device that detects scent of food, if a positive result and prob>0.5 then apply temp basal. See what I mean?
Scott Leibrand
@scottleibrand
Aug 01 2016 21:08
@bfaloona the eventualBG calculation is based on IOB, so you're expected to get there within DIA hours (or maybe a bit sooner if most of your insulin was awhile ago)
Brandon Faloona
@bfaloona
Aug 01 2016 21:09
@scottleibrand That makes sense. Thanks.
@scottleibrand Any suggestions for how to debug these incorrect IOB numbers? I don't think it's a bug, but perhaps I have something configured incorrectly.
@scottleibrand Re: 'eventualBG' - I assume it include COB as well?
John Dodds
@johners97
Aug 01 2016 21:28
pi@john:~/my_openaps $ openaps do-everything
monitor/clock.json
tz://JSON/clock/monitor/clock.json
reporting monitor/clock.json
PREFLIGHT OK
insulin_pump://JSON/iter_glucose/raw-pump/mm-glucose.json
raw-pump/mm-glucose.json  raised  ACK is 0 bytes:

Traceback (most recent call last):
  File "/usr/local/bin/openaps-report", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-report')
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 719, in run_script
  File "/usr/local/lib/python2.7/dist-packages/setuptools-24.2.0-py2.7.egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 82, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-report", line 75, in run
    output = app(args, self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/subcommand.py", line 52, in __call__
    return self.method.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/reports/invoke.py", line 40, in main
    output = task.method(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/use.py", line 44, in __call__
    self.before_main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/vendors/medtronic.py", line 61, in before_main
    self.setup_medtronic( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/vendors/medtronic.py", line 160, in setup_medtronic
    self.uart.open( )
  File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.30-py2.7.egg/decocare/stick.py", line 874, in open
    log.info('%s' % self.product_info( ))
  File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.30-py2.7.egg/decocare/stick.py", line 515, in product_info
    return self.query(ProductInfo)
  File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.30-py2.7.egg/decocare/stick.py", line 509, in query
    return self.process( )
  File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.30-py2.7.egg/decocare/stick.py", line 496, in process
    ack, response = self.command.respond(raw)
  File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.30-py2.7.egg/decocare/stick.py", line 71, in respond
    raise AckError("ACK is 0 bytes:\n%s" % lib.hexdump(raw))
decocare.errors.AckError: ACK is 0 bytes:
Hmmm
OpenAPS was working 40 mins ago..
Scott Leibrand
@scottleibrand
Aug 01 2016 21:34
@bfaloona if you're using AMA with the latest oref0 dev, it will include any projected carb impact up until DIA+30m from now (to give any currently-running temps time to complete and take full effect). that will mean that all of COB is included if carb absorption is occurring fast enough, but only some of it if current deviation is minimal
@bfaloona sounded like you had a lead on the basal profile being incorrect, and not refreshing in your loop?
John Dodds
@johners97
Aug 01 2016 21:43
anyone got any ideas what this issue might be caused by
Ahh it could the carelink stick, i'll reset usb and see if it works
Indeed it is
Tried mm-stick warmup || echo FAIL and it outputs that^
then FAIL
sudo oref0-reset-usb
trying this, if it fails i will insert a new stick
John Dodds
@johners97
Aug 01 2016 21:48
crisis averted
Fixed, sorry for "spamming" this about a seemingly trivial problem
Is it just me or do you think more logically since starting with OpenAPS? If this was a few weeks ago I would start freaking out. Amazing what actually reading the error does in terms of being able to fix stuff!
Scott Leibrand
@scottleibrand
Aug 01 2016 22:51
@bfaloona I would start by digging down and reproducing just the thing that seems to be incorrect.
Are you referencing selected-basal-profile.json in your oref0-get-profile report?
Brandon Faloona
@bfaloona
Aug 01 2016 22:54
I'm referenceing settings/selected-basal-profile.json in my oref0-monitor/profile.json report
... and it looks correct:
pi@openaps-lp:~/openaps-lp $ openaps report invoke settings/selected-basal-profile.json
oref0://JSON/shell/settings/selected-basal-profile.json
reporting settings/selected-basal-profile.json
pi@openaps-lp:~/openaps-lp $ cat settings/selected-basal-profile.json
[
  {
    "i": 0, 
    "start": "00:00:00", 
    "rate": 0.7000000000000001, 
    "minutes": 0
  }, 
  {
    "i": 1, 
    "start": "03:00:00", 
    "rate": 0.675, 
    "minutes": 180
  }, 
  {
    "i": 2, 
    "start": "08:00:00", 
    "rate": 0.8, 
    "minutes": 480
  }, 
  {
    "i": 3, 
    "start": "17:00:00", 
    "rate": 1.1, 
    "minutes": 1020
  }, 
  {
    "i": 4, 
    "start": "17:30:00", 
    "rate": 0.5, 
    "minutes": 1050
  }, 
  {
    "i": 5, 
    "start": "18:00:00", 
    "rate": 0.8, 
    "minutes": 1080
  }
]
Scott Leibrand
@scottleibrand
Aug 01 2016 22:56
ok. next steps are to confirm the behavior with an openaps use command, and then drill down to the actual oref0 command that underlies that
the actual IOB calculation report, use, and command, that is
and while we're at it, check the inputs provided to those commands to make sure they all look right.
Ben West
@bewest
Aug 01 2016 22:58
openaps report show --cli questionable-report.json or similar will show the corresponding use commands
Brandon Faloona
@bfaloona
Aug 01 2016 23:25
Ignoring intermittent crashes (caused, I assume, by CareLink errors, or the loop timing being wrong and thus dependent reports are missing)...
... I can only see an error with iob.json
The other reports look reasonable.
Scott Leibrand
@scottleibrand
Aug 01 2016 23:26
ok, so we need to do the thing ben suggested to find the openaps use command for iob.json, and then drill down to make sure we can reproduce it with the underlying oref0 command (oref-calculate-iob)
Ben West
@bewest
Aug 01 2016 23:27
openaps report show --cli oref0-predict/iob.json is that what it's called?
that will print the use
Brandon Faloona
@bfaloona
Aug 01 2016 23:28
pi@openaps-lp:~/openaps-lp $ openaps report show --ini oref0-monitor/iob.json 
[report "oref0-monitor/iob.json"]
use = shell
clock = monitor/clock.json
reporter = text
json_default = True
pump-history = monitor/pump-history.json
oref0-profile = oref0-monitor/profile.json
device = calculate-iob
remainder =
Scott Leibrand
@scottleibrand
Aug 01 2016 23:29
we wanted --cli
Brandon Faloona
@bfaloona
Aug 01 2016 23:29
oh
pi@openaps-lp:~/openaps-lp $ openaps report show --cli oref0-monitor/iob.json 
openaps use calculate-iob shell monitor/pump-history.json oref0-monitor/profile.json monitor/clock.json 
pi@openaps-lp:~/openaps-lp $ openaps use calculate-iob shell monitor/pump-history.json oref0-monitor/profile.json monitor/clock.json
{
  "netbasalinsulin": -0.15, 
  "activity": 0.0006, 
  "basaliob": -0.135, 
  "hightempinsulin": 0, 
  "bolussnooze": 0.621, 
  "iob": 0.525
}
Scott Leibrand
@scottleibrand
Aug 01 2016 23:31
and is that approximately correct, or totally off?
looks like it thinks you did a bolus not too long ago
might also be worth pasting your clock.json and the most recent bolus record from the pump-history.json
Brandon Faloona
@bfaloona
Aug 01 2016 23:35
the basaliob is incorrect. the treatments iob (ns language) always looks correct.
i'll get the clock and bolus.
pi@openaps-lp:~/openaps-lp $ cat monitor/clock.json 
"2016-08-01T16:29:58"
that's the correct local time here.
Scott Leibrand
@scottleibrand
Aug 01 2016 23:36
also check to see if the iob roughly matches what your pump says
Brandon Faloona
@bfaloona
Aug 01 2016 23:40
active insulin on pump is 0.550.
Here's the bolus:
  {
    "_type": "Bolus", 
    "_description": "Bolus 2016-08-01T14:41:39 head[8], body[0] op[0x01]", 
    "timestamp": "2016-08-01T14:41:39-07:00", 
    "_body": "", 
    "appended": [
      {
        "_type": "UnabsorbedInsulinBolus", 
        "_description": "UnabsorbedInsulinBolus unknown head[5], body[0] op[0x5c]", 
        "_body": "", 
        "_head": "5c051b5914", 
        "data": [
          {
            "amount": 0.675, 
            "age": 345
          }
        ], 
        "_date": ""
      }
    ], 
    "programmed": 1.25, 
    "duration": 0, 
    "amount": 1.25, 
    "unabsorbed": 0.0, 
    "_head": "0100320032000000", 
    "type": "normal", 
    "_date": "a7292e0110"
  }, 
  {
    "_type": "BolusWizard", 
    "bg": 120, 
    "_description": "BolusWizard 2016-08-01T14:41:39 head[2], body[15] op[0x5b]", 
    "timestamp": "2016-08-01T14:41:39-07:00", 
    "_body": "115000785082fa0038f80000003282", 
    "carb_input": 17, 
    "bg_target_high": 130, 
    "sensitivity": 80, 
    "carb_ratio": 12.0, 
    "food_estimate": 1.4, 
    "unabsorbed_insulin_total": 0.0, 
    "correction_estimate": 51.05, 
    "bg_target_low": 130, 
    "_head": "5b78", 
    "bolus_estimate": 1.25, 
    "_date": "a7290e0110"
  },
Brandon Faloona
@bfaloona
Aug 01 2016 23:46
The temp basals that were set of the last 4 hours are what is generating the basaliob, so do you want to see the temp basal events too?
Scott Leibrand
@scottleibrand
Aug 01 2016 23:47
so I see one problem: your pump-history.json is zoned, but your clock.json is not
Brandon Faloona
@bfaloona
Aug 01 2016 23:52
I tried running the use pointed at clock-zoned.json instead, but that returned 0's for all calculations.
Scott Leibrand
@scottleibrand
Aug 01 2016 23:54
hmm, can you paste clock-zoned.json then?
Ben West
@bewest
Aug 01 2016 23:55
sounds like maybe they both exist but aliases maybe not keeping them in sync?
Brandon Faloona
@bfaloona
Aug 01 2016 23:56
clock-zoned.json cli is:
pi@openaopenaps use tz clock --date None monitor/clock.json
"2016-08-01T16:49:58-07:00"
@bewest I think it is updated.
pi@openaps-lp:~/openaps-lp $ openaps alias show warmup
warmup report invoke model.json raw-pump/clock-raw.json monitor/clock.json
Scott Leibrand
@scottleibrand
Aug 01 2016 23:57
and that matches the actual contents of the clock-zoned.json file?
or is clock-zoned.json not getting refreshed?
Brandon Faloona
@bfaloona
Aug 01 2016 23:58
hmmm.
I think that's it.