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

1st
Jul 2016
Paul Dickens
@thebookins
Jul 01 2016 00:34
thx @danamlewis, couldn't see anything on the hardware page (only a link to some hard-coded reports), but I'll go through the error report in more detail tonight and see where it gets stuck
Andy Probolus
@AndyProbolus_twitter
Jul 01 2016 01:00
@iananders did you get the BG data is too old issue issue resolved? It took us a while to figure out that even though our timezones were correct and we were creating our pumphistory-zoned report correctly, it wasn't outputting data with a timezone on it, which was giving us that error your kept getting.
mshafa
@mshafa
Jul 01 2016 01:08
Hi. When invoking reports, I get this error: AttributeError: 'Pump' object has no attribute 'model'. Could anyone help?
Andy Probolus
@AndyProbolus_twitter
Jul 01 2016 01:13
@mshafa sounds like your pump device is missing the 'model' attribute. you could check this by looking at your openaps.ini file or look at how you set up your pump device. Or, maybe you are missing a pump model report?
mshafa
@mshafa
Jul 01 2016 01:15
@AndyProbolus_twitter Thank you. I will check it .
Andy Probolus
@AndyProbolus_twitter
Jul 01 2016 01:16
@mshafa correction - check pump.ini file instead of openaps.ini
Jeremy M Lucas (GetRileyLink.org)
@jlucasvt
Jul 01 2016 02:14
@mshafa I get that error when the Carelink is not close enough. I need to be within 2ft or most pump communications fails.
Chris Oattes
@cjo20
Jul 01 2016 02:19
blob
Is there anyone that would be interested in having the OpenAPS NS pill formatted more like this:
Paul Martin
@Spazholio
Jul 01 2016 02:22
I wouldn’t object to having the pill be a bit more readable.
Chris Oattes
@cjo20
Jul 01 2016 02:26
I need to get rid of the "3m Ago" from the IOB. Would you have any other suggestions?
Paul Martin
@Spazholio
Jul 01 2016 02:28
Is it just standard HTML formatting in that pill?
I would mind just some more line breaks, really. Logical breaks for different bits of info.
Chris Oattes
@cjo20
Jul 01 2016 02:28
not really. It's built up as a list of objects
Paul Martin
@Spazholio
Jul 01 2016 02:28
I’ve never considered what I’d want in there. Give me a moment.
Chris Oattes
@cjo20
Jul 01 2016 02:29
Each thing on a new line there is a separate bit of info in a field in the JSON document produced by ns-status
Paul Martin
@Spazholio
Jul 01 2016 02:29
So are you asking what bits of information should be in there, or how should what’s already in there be formatted?
shgrady @shgrady 's husband rips medtronic pump off in the heat of the moment, killing the mood, bounty for OmniAPS gains considerable increase.
Chris Oattes
@cjo20
Jul 01 2016 02:30
For now, how things should be formatted. Many more lines might start to get difficult to read on smaller devices
Paul Martin
@Spazholio
Jul 01 2016 02:30
Ooooh, good call.
Maybe have the “3m ago” be where it is, and everything that’s bolded underneath it remain bolded, but slightly indented?
Chris Oattes
@cjo20
Jul 01 2016 02:33
http://i.imgur.com/ipUdlM9.png that's how it looks on an iphone 6 atm
Paul Martin
@Spazholio
Jul 01 2016 02:35
This is likely just a personal thing, but I’d be interested what it looks like seeing all the numbers in italics. It just helps draw the eye and delineate between labels and values. I imagine that’s not the simplest thing to do though.
Chris Oattes
@cjo20
Jul 01 2016 02:48
blob
Some of the values italicised
Iterating on this is a pain, because it's got to be commited to git, then azure has to pick up the change and deploy it
Paul Martin
@Spazholio
Jul 01 2016 02:53
Yeah, the italicizing isn’t working like I thought it would. Feel free to discontinue it if you’d like. =)
Oh, you program the RIGHT way. I’ve never gotten the hang of that. =)
Ben West
@bewest
Jul 01 2016 02:54
@cjo20 you can run it locally
Chris Oattes
@cjo20
Jul 01 2016 02:58
I'll need to look in to that if I play around with NS any more
Chris Oattes
@cjo20
Jul 01 2016 03:05
@Spazholio with indentation
blob
Paul Martin
@Spazholio
Jul 01 2016 03:05
Diggin’ it.
Chris Oattes
@cjo20
Jul 01 2016 03:10
Any other comments before I tidy up the code for a PR would be welcome
Paul Martin
@Spazholio
Jul 01 2016 03:12
This is such a small thing (but you asked) - that bit underneath “Reason” - can that be indented as well, or is that just a quirk of the wrapping text?
Chris Oattes
@cjo20
Jul 01 2016 03:13
That's not trivial. Basically, I can pass a string for it to display, so adding spaces to the start is easy. Indenting it when it wraps would involve finding the cost that actually generates the tooltip itself
Sleeptime o/
Paul Martin
@Spazholio
Jul 01 2016 03:15
No worries.
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 05:55

anyone got a sec for issues with NS and tz...?
`pi@raspberrypi:~/openaps-20160611/my_openaps $ cat monitor/clock-zoned.json && echo -e "\n"
"2016-06-30T22:50:55-07:00"

pi@raspberrypi:~/openaps-20160611/my_openaps $ cat monitor/clock.json && echo -e "\n"
"2016-06-30T22:50:55"

pi@raspberrypi:~/openaps-20160611/my_openaps $ date
Thu Jun 30 22:54:49 PDT 2016`
so tz seems to be working right.

however, when I upload to nightscout all my data is offset by gmt -7 (PDT) which is my correct timezone. The data shouldn't be offset though.
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 06:03
to contiue;
from pumphistory.json:
{ "_type": "TempBasal", "temp": "absolute", "_description": "TempBasal 2016-06-30T22:51:31 head[2], body[1] op[0x33]", "timestamp": "2016-06-30T22:51:31", "_body": "00", "_head": "3334", "rate": 1.3, "_date": "5fb3165e10" },
from pumphistory-zoned.json:
{ "_type": "TempBasal", "temp": "absolute", "_description": "TempBasal 2016-06-30T22:51:31 head[2], body[1] op[0x33]", "timestamp": "2016-06-30T22:51:31", "_body": "00", "_head": "3334", "rate": 1.3, "_date": "5fb3165e10" },
but this doesn't show up. The only data that shows up on the NS site is from 7 hours ago. Thoughts? TYIA.
Marianne Smith, PMP
@mariannesmith77_twitter
Jul 01 2016 10:16
@kimstdennis_twitter @Spazholio helped me with just that on June 23 in this chat room. Search for pumphistory and I think you will find it. I was using @AndyProbolus_twitter account then. Short answer for us was that this data didn't correctly tome
Oops.
Time zone until we set it up directly in openaps.ini.
Correction. June 25 @kimstdennis_twitter
John Sjolund
@sjolundjohn
Jul 01 2016 11:48

Are there ways that one can easily control which information is uploaded to Nightscout during the upload process?

I am experimenting with using Nightscout data, coming from the new Medtronic 640g uploader, as the BG value for OpenAPS (more questions to come, not working).

The problem I have is that both the 640g uploader as well as the OpenAPS rig is uploading basil rates

Paul Martin
@Spazholio
Jul 01 2016 12:44
@kimstdennis_twitter It doesn't look like your pumphistory-zoned.json is actually getting zoned.
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 16:43
@mariannesmith77_twitter thanks for the help
@Spazholio can you post a sample of zoned data? I'm not sure what the changes are that I'm looking for when I test.
and thanks
another question, if my local timezone is pst (pdt currently), and my nightscout site is also displaying pdt, what am I trying to zone things to? UTC?
Paul Martin
@Spazholio
Jul 01 2016 16:48
I don't have ready access to a raw file, but your timestamp field will either have a Z in it (to indicate Zulu time) or -07:00 to indicate that it's PDT.
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 16:52
that's perfect, thanks.
so when uploading to NS, your data needs to be in utc + timezone ie., timestamp": "2016-06-30T22:51:31 -07:00 ? that timestamp correlates to pdt which is what my pump, system clock, NS site, etc. are all in.
Paul Martin
@Spazholio
Jul 01 2016 16:57
Yes, I believe so.
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 16:57
maybe my system clock needs to be in UTC in order to have tz do the offset
Paul Martin
@Spazholio
Jul 01 2016 16:57
I don't think so. Do you have you TZ set on your system?
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 17:02
[device "tz"] vendor = openapscontrib.timezones extra = tz.ini
and
cat tz.ini [device "tz"]
and
[report "monitor/pumphistory-zoned.json"] use = rezone reporter = JSON astimezone = False date = None adjust = missing input = monitor/pumphistory.json device = tz timezone = PDT
I've tried to change that timezone up a bit pst, pdt, utc, etc.
Paul Martin
@Spazholio
Jul 01 2016 17:05
Hmmm. Try switching that astimezone = False to True and then reinvoke the -zoned report. See if that changes things.
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 17:05
with no luck
Paul Martin
@Spazholio
Jul 01 2016 17:05
And to paste multi-line code, put it between three backticks instead of just one. It'll be a lot easier to read. =)
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 17:06
results from monitor/pumphistory-zoned.json
    "_type": "TempBasalDuration",
    "_description": "TempBasalDuration 2016-07-01T10:01:40 head[2], body[0] op[0x16]",
    "timestamp": "2016-07-01T10:01:40",
    "_body": "",
    "_head": "1601",
    "duration (min)": 30,
    "_date": "68c10a4110"
  },
  {
Paul Martin
@Spazholio
Jul 01 2016 17:07
Hang on...
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 17:09
yup
Paul Martin
@Spazholio
Jul 01 2016 17:10
Ok, I can't seem to get into my rig right now. It's not showing up in /dev when I plug it in. @bewest or @scottleibrand - if I plug my serial USB port into a linux machine, it should show up as /dev/ttyUSB0 right? If there are no new devices in there when I plug it in, what might I be doing incorrectly?
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 17:13
got it
Paul Martin
@Spazholio
Jul 01 2016 17:14
Oh
?
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 17:14
[report "monitor/pumphistory-zoned.json"]
use = rezone
reporter = JSON
astimezone = Falso
date = timestamp dateString start_at end_at created_at
adjust = missing
input =monitor/pumphistory.json
device = tz
timezone = PDT

it's the

date = timestamp dateString start_at end_at created_at

that did the trick.

Paul Martin
@Spazholio
Jul 01 2016 17:14
Ohhh, crap. You didn't have a date= line in there. My bad.
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 17:15
pi@raspberrypi:~/openaps-20160611/my_openaps $ head monitor/pumphistory-zoned.json
[
  {
    "_type": "TempBasalDuration",
    "_description": "TempBasalDuration 2016-07-01T10:01:40 head[2], body[0] op[0x16]",
    "timestamp": "2016-07-01T10:01:40-07:00",
    "_body": "",
    "_head": "1601",
    "duration (min)": 30,
    "_date": "68c10a4110"
  },
I'll have to add that to the docs. thanks for the help @Spazholio
Paul Martin
@Spazholio
Jul 01 2016 17:17
np
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 17:18
do we have anything describing what the different options do, like date, _body, _head, etc.
Ben West
@bewest
Jul 01 2016 19:02
that's the raw pump memory, more or less
it's for debugging in the case the decoding is wrong, there's potentially a way to re-assemble the records raw version and see what happened
jim-andrews
@jim-andrews
Jul 01 2016 19:48
Just wanted to jump in and say thanks for spectacular documentation. I'm now reading data from my G4 and my 722 pump without issue. Looking forward to starting the open loop data analysis over the holidays.
cdaccarett
@cdaccarett
Jul 01 2016 20:41
quick question when report invoking should i add the whole path or just name for example openaps report invoke /model/model.json or just openaps report invoke model.json ?
Ben West
@bewest
Jul 01 2016 20:41
latter
not sure what you mean, actually
report names are all relative to the directory we're in
cdaccarett
@cdaccarett
Jul 01 2016 20:42
when i do report show
Ben West
@bewest
Jul 01 2016 20:42
so it should all be model.json or raw-pump/pump-history.json or similar
ah
try this: openaps report show --json | json -g | json -a name
cdaccarett
@cdaccarett
Jul 01 2016 20:43
it gives me pump://JSON/model/model.json so im just wondering if i should do openaps report invoke /model/model.json or openaps report invoke model.json
Ben West
@bewest
Jul 01 2016 20:44
the url is constructed like this: $device://$format/$use/$report
openaps report show --json | json -g | json -a name this will print just the filename
cdaccarett
@cdaccarett
Jul 01 2016 20:44
Oh i see, okay thank you!
Paul Martin
@Spazholio
Jul 01 2016 20:46
Don’t do that front slash. You have openaps report invoke /model/model.json but you should have openaps report invoke model/model.json
Ben West
@bewest
Jul 01 2016 20:46
given that we're mostly sane people, the report names typically bear some hint/relationship to the "use" involved
no, in this case it's simply model.json
the url saysmodel/model.json because it's an URI-spec telling us information about which device, format and use is involved, followed by the report name itself
in this case, the use is model, and the report is model.json
cdaccarett
@cdaccarett
Jul 01 2016 20:47
pump://JSON/read_settings/raw-pump/settings.json
i was just wondering when invoking these would i add the path /settings/ and /raw-pump/
Ben West
@bewest
Jul 01 2016 20:47
in any case, if you openaps report invoke you can [tab][tab] autocomplete to get a pop up list
cdaccarett
@cdaccarett
Jul 01 2016 20:48
oref0://JSON/shell/settings/settings.json
pump://JSON/read_settings/raw-pump/settings.json
Ben West
@bewest
Jul 01 2016 20:48
you can just try it manually and see :-)
cdaccarett
@cdaccarett
Jul 01 2016 20:48
:0
:)
Ben West
@bewest
Jul 01 2016 20:48
openaps report show --json | json -g | json -a name will tell you the exact name of the reports
if you tab complete, it generates popup list to autocomplete
if you try one and it errors, it will also give you a list of available reports
cdaccarett
@cdaccarett
Jul 01 2016 20:48
okay got it, thanks again
Paul Martin
@Spazholio
Jul 01 2016 20:59
@bewest I was copying/pasting sans reading. My bad.
cdaccarett
@cdaccarett
Jul 01 2016 21:00
$ openaps report invoke settings/bg-targets.json
Traceback (most recent call last):
  File "/usr/local/bin/openaps-report", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/home/pi/openaps/bin/openaps-report", line 82, in <module>
    app( )
  File "/home/pi/openaps/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/home/pi/openaps/bin/openaps-report", line 75, in run
    output = app(args, self)
  File "/home/pi/openaps/openaps/cli/subcommand.py", line 52, in __call__
    return self.method.main(args, app)
  File "/home/pi/openaps/openaps/reports/invoke.py", line 23, in main
    device = app.devices[report.fields['device']]
KeyError: 'units'
sorry for all the questions but im not sure the error on this
'units' ?
Ben West
@bewest
Jul 01 2016 21:02
means units device is missing
to add it: openaps device add units units
(units is a built-in vendor)
cdaccarett
@cdaccarett
Jul 01 2016 21:14
not sure if i missed it in the doc's but is there a list of the built-in vendors, i have a feeling i missed to add a couple im getting KeyError: 'determine-basal' errors aswell as KeyError: 'oref0'
Ben West
@bewest
Jul 01 2016 21:14
missing oref0
oref0 template mint device oref0 | openaps import
cdaccarett
@cdaccarett
Jul 01 2016 21:17
thank you, that fixed it :+1:
cdaccarett
@cdaccarett
Jul 01 2016 21:28
@bewest When trying to add my Dexcom G5 data i keep getting this error, can i make the int size smaller so its able to convert?
pi@raspberrypi:~/raspPiAPS $ openaps use cgm config --G5
{
  "model": "G5"
}pi@raspberrypi:~/raspPiAPS $ openaps report add raw-cgm/glucose-raw.json JSON cgm oref0_glucose  --no-raw --hurs 2.0

added cgm://JSON/oref0_glucose/raw-cgm/glucose-raw.json
pi@raspberrypi:~/raspPiAPS $ 
pi@raspberrypi:~/raspPiAPS $ openaps report invoke raw-cgm/glucose-raw.json
cgm://JSON/oref0_glucose/raw-cgm/glucose-raw.json
raw-cgm/glucose-raw.json  raised  Python int too large to convert to C long
Traceback (most recent call last):
  File "/usr/local/bin/openaps-report", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/home/pi/openaps/bin/openaps-report", line 82, in <module>
    app( )
  File "/home/pi/openaps/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/home/pi/openaps/bin/openaps-report", line 75, in run
    output = app(args, self)
  File "/home/pi/openaps/openaps/cli/subcommand.py", line 52, in __call__
    return self.method.main(args, app)
  File "/home/pi/openaps/openaps/reports/invoke.py", line 40, in main
    output = task.method(args, app)
  File "/home/pi/openaps/openaps/uses/use.py", line 45, in __call__
    output = self.main(args, app)
  File "/home/pi/openaps/openaps/vendors/dexcom.py", line 536, in main
    for egv, raw in itertools.izip_longest(iter_glucose, iter_sensor):
  File "/usr/local/lib/python2.7/dist-packages/dexcom_reader-0.1.10-py2.7.egg/dexcom_reader/readdata.py", line 300, in iter_records
    for x in reversed(xrange(start, end)):
OverflowError: Python int too large to convert to C long
Ben West
@bewest
Jul 01 2016 21:28
for G5: openaps use config --G5
oh, you did
you're using G5 through usb?
cdaccarett
@cdaccarett
Jul 01 2016 21:29
Yeah through USB
Ben West
@bewest
Jul 01 2016 21:29
openaps use cgm GetFirmwareHeader
oh
well there's no raw data on G5
so you can't get raw, that's known
you can get glucose values just fine though
I recommend oref0_glucose --no-raw
cdaccarett
@cdaccarett
Jul 01 2016 21:30
trying this command openaps report add raw-cgm/glucose-raw.json JSON cgm oref0_glucose --no-raw --hours 2.0
Ben West
@bewest
Jul 01 2016 21:31
I would just do use until it's right
openaps use cgm oref0_glucose --no-raw --hours 2.0
cdaccarett
@cdaccarett
Jul 01 2016 21:32
doesn't give me an error just a []
Ben West
@bewest
Jul 01 2016 21:32
also: openaps use cgm GetFirmwareHeader
ah, that's progress
cdaccarett
@cdaccarett
Jul 01 2016 21:32
i get all the information back with openaps use cgm GetFirmwareHeader
Ben West
@bewest
Jul 01 2016 21:32
would love to see it
cdaccarett
@cdaccarett
Jul 01 2016 21:33
{
  "DexBootVersion": "3", 
  "BLESoftwareVersion": "1.0.0.76/1.0.1", 
  "RFVersion": "1", 
  "ApiVersion": "3.0.0.0", 
  "ProductName": "Dexcom G5 Mobile Receiver", 
  "SoftwareNumber": "SW10617", 
  "TestApiVersion": "2.10.0.0", 
  "BLEHardwareVersion": "HW003C", 
  "SchemaVersion": "1", 
  "ProductId": "G5MobileReceiver", 
  "PortVersion": "4.6.4.62", 
  "FirmwareVersion": "4.0.1.030", 
  "BLEDeviceAddress": "610270B0DBC1"
}
Ben West
@bewest
Jul 01 2016 21:33
ah great
openaps use cgm iter_glucose 1?
cdaccarett
@cdaccarett
Jul 01 2016 21:34
Works i get my latest reading
Ben West
@bewest
Jul 01 2016 21:36
but openaps use cgm oref0_glucose --no-raw -n 1 --hours 2 fails?
cdaccarett
@cdaccarett
Jul 01 2016 21:37
Yeah it returns a []
Ben West
@bewest
Jul 01 2016 21:38
oh... curious what version of dexcom_reader you might have
also curious how you installed things: do you have ls ~/src/ ?
cdaccarett
@cdaccarett
Jul 01 2016 21:39
decoding-carelink dexcom_reader openaps openaps-contrib oref0
in ls ~/src/
Ben West
@bewest
Jul 01 2016 21:39
:-$ my recommendations have not hit docs yet apparently
cdaccarett
@cdaccarett
Jul 01 2016 21:40
i installed using the package manager
curl -s https://raw.githubusercontent.com/openaps/docs/master/scripts/quick-packages.sh | bash -
Paul Martin
@Spazholio
Jul 01 2016 21:40
Question regarding my pump targets - for the past few weeks, I’ve been noticing that from 4-6pm, I’ve had lows. My pump range is set from 100-100 right now. Would it make sense to set the pump range to 115-115, or 100-115? I don’t know the ins and outs of tha algorithm OpenAPS uses well enough to figure that one out on my own.
Ben West
@bewest
Jul 01 2016 21:41
(sudo rm -Rf ~/src/dexcom_reader; sudo pip install -U dexcom_reader)
@Spazholio what would you do if you didn't have openaps?
Paul Martin
@Spazholio
Jul 01 2016 21:41
If I didn’t have OpenAPS, I wouldn’t be set to 100-100 in the first place.
I was set to 90-110, I think. Maybe 80-110.
Ben West
@bewest
Jul 01 2016 21:42
if were going low every afternoon, I might consider nudging the basal rate during that time
cdaccarett
@cdaccarett
Jul 01 2016 21:43
getting some permission denied errors
Ben West
@bewest
Jul 01 2016 21:43
unless I thought it was a sensitivity issue or something, in which case, I might schedule a slightly different sensitivity or schedule, thinking about what would happen if I ran my bolus wizard every 5 minutes
cdaccarett
@cdaccarett
Jul 01 2016 21:43
rm: cannot remove ‘/home/pi/src/dexcom_reader/dexcom_reader.egg-info/top_level.txt’: Permission denied
rm: cannot remove ‘/home/pi/src/dexcom_reader/dexcom_reader.egg-info/PKG-INFO’: Permission denied
rm: cannot remove ‘/home/pi/src/dexcom_reader/dexcom_reader.egg-info/requires.txt’: Permission denied
rm: cannot remove ‘/home/pi/src/dexcom_reader/dexcom_reader.egg-info/dependency_links.txt’: Permission denied
rm: cannot remove ‘/home/pi/src/dexcom_reader/dexcom_reader.egg-info/not-zip-safe’: Permission denied
rm: cannot remove ‘/home/pi/src/dexcom_reader/dexcom_reader.egg-info/SOURCES.txt’: Permission denied
Ben West
@bewest
Jul 01 2016 21:44
I added a sudo above
(sudo rm -Rf ~/src/dexcom_reader; sudo pip install -U dexcom_reader)
Paul Martin
@Spazholio
Jul 01 2016 21:44
Well, that’s another question I have - isn’t my basal rate quite a bit less important now that I’m looping? If I set it to 1.8 or 2.0, OpenAPS is still going to adjust based on my ISF and where my number are and where they’re trending. So let’s assume I adjust my basal rate. How does OpenAPS take that into account if I leave my targets at 100-100?
Ben West
@bewest
Jul 01 2016 21:45
you'll be getting less insulin over the lead up to the time you usually go low naturally
which means you likely won't go low because there won't be as much pressure pushing glucose down
meaning it'll be easier for openaps to actually hit the target because it's so much harder to undo that pressure than to apply it
Paul Martin
@Spazholio
Jul 01 2016 21:46
Will I? How does the loop take the basal rate into account when attempting to keep my numbers in check? I can see it using glucose/ISF/ratios but don’t see how it uses the basal rates in the pump in its determination.
cdaccarett
@cdaccarett
Jul 01 2016 21:46
successfully installed
Ben West
@bewest
Jul 01 2016 21:46
the temporary rates are always considered a deviation from the scheduled rate
Paul Martin
@Spazholio
Jul 01 2016 21:47
Like, if my standard basal rate was insanely high, like 5u/hr, the loop would still temp it lower if it saw me plummeting, no?
Ben West
@bewest
Jul 01 2016 21:47
but the pressure is already there because you got it
Paul Martin
@Spazholio
Jul 01 2016 21:47
What does a deviation from the scheduled rate mean from a looping perspective? I understand the term, but don’t understand how it applies to the looping logic.
Ben West
@bewest
Jul 01 2016 21:47
the basal rates are presumed to give you a flat line more or less
if your basal rate causes your line to dip, it needs to be decresed
Paul Martin
@Spazholio
Jul 01 2016 21:48
Right.
Ben West
@bewest
Jul 01 2016 21:48
that will affect the loop dramatically, becaues the loop can't un-give that amount of pressure
it's less about loop logic and more about basal, sounds like
Paul Martin
@Spazholio
Jul 01 2016 21:49
So once I get closer to my goal of 100, the loop will assume it’s ok to go back to my hypothetical default of 5u?
I think I’m getting a glimmer of understanding here, just want to make sure I’m going down the right rabbit hole here.
Ben West
@bewest
Jul 01 2016 21:50
an accurate basal rate will make it easier for openaps to intervene less
less intervention means less disturbance, less noise, which means the interventions that do occur are also more likely to be accurate
if pump settings are wrong, including basal rate, it'll be much harder for openaps to establish a steady state
mm22dl
@mm22dl
Jul 01 2016 21:51
Hey there! Don't know if this is known by some of you, but wanted to share this weird experience I had with an Enlite coupled with my 640g... I was getting ready for lunch today, with a BG of 97, having been stable for the last 2-3 hours, when, after giving a bolus of 15U for 90g of carbs, the bolus was suddenly stopped by SmartGuard after only 1.550U were given, supposedly because I was going low, although no such trend was visible
Paul Martin
@Spazholio
Jul 01 2016 21:51
Ok. Can I ask why you feel adjusting the basal rate is better than adjusting the targets for the problematic times? I changed my targets for my overnight lows and it seems to be helping.
Not being contrary, just trying to understand your suggestions. =)
Ben West
@bewest
Jul 01 2016 21:52
changing targets might help as well
I walk away from my loop fairly often
mm22dl
@mm22dl
Jul 01 2016 21:52
have you guys ever heard of that? that seems like a relatively dangerous bug, considering someone could put their pump in their pocket, like I always do, and miss the interruption of a large bolus...
Ben West
@bewest
Jul 01 2016 21:52
in general the loop is assuming you're doing everything you can do to get the best settings and best treatment
it doesn't make sense to me that you could give openaps inaccurate basal rates and it could just fix it, it's not that magical
Paul Martin
@Spazholio
Jul 01 2016 21:53
Sans loop, my target changes wouldn’t do a damned thing for my overnight lows though, but a basal rate change would.
Ben West
@bewest
Jul 01 2016 21:53
the target gives it permission on how aggressive to be
right, so think about creating most surface area for stability
that would be continually improving the pump's performance as much as possible
Paul Martin
@Spazholio
Jul 01 2016 21:54
Well, not magical, but close. =) But if I tell the loop “here’s my target and here’s my basal rate” and the loop sees me dipping below that target, I assume it would naturally lower the basal to help me maintain the target range, no?
Ben West
@bewest
Jul 01 2016 21:55
my pump is in my pocket, not sure what you mean, I've never had a bolus interrupted by anything (although occasionally forget to confirm all the way)
yes, it will
but what if the basal rate already gave you too much?
what's your DIA?
how long will it take for a stoppage of insulin to have any effect on a low?
Paul Martin
@Spazholio
Jul 01 2016 21:55
I’m assuming it’s 4. I mean, that’s what it’s set to, but it’s a guess at best.
Ben West
@bewest
Jul 01 2016 21:55
how much insulin active would it take to overwhelm that time gap?
if if you get 5U and you're 160 - 120 for a few hours, you'll get 10U over 2 hours
at that point... yeah if we shut off insulin altogether, you've still got 10U on board...
Paul Martin
@Spazholio
Jul 01 2016 21:56
Right. Also, remember that 5u is completely hypothetical. My real basal is 1.8u.
But I take your meaning.
Ben West
@bewest
Jul 01 2016 21:56
right, but what happens when you have 10U on board already?
it's impossible to cancel that much insulin, it's already doing it's thing
Paul Martin
@Spazholio
Jul 01 2016 21:57
So a few hours before the 4-6pm problematic times, I should lower my basal rates for the same duration as my problematic times to just get that much less insulin in me.
Ben West
@bewest
Jul 01 2016 21:57
openaps can make slight adjustments, but not anywhere near that big
Paul Martin
@Spazholio
Jul 01 2016 21:57
Ok, I think I’m wrapping my head around it...
Ben West
@bewest
Jul 01 2016 21:57
yeah, I'd adjust basal
increase surface area of stability
Paul Martin
@Spazholio
Jul 01 2016 21:58
Generally speaking, if I’m having issues from 4-6pm, and my DIA is 4, I should lower my basal rates from 12-2pm?
That feels too early for me, but it’s just a feeling - no real logic behind it...
mm22dl
@mm22dl
Jul 01 2016 21:58
@bewest: I had the pump on the table, asked for the bolus, which was then stopped by the pump... I am assuming it wouldn't have been resumed afterwards, cause 1.550U was saved in the pump's histroy
Ben West
@bewest
Jul 01 2016 21:58
depends on when the issue is, etc
I'd do a bit later ... the time to beginning of action and time to peak action is what matters
you want it so that the peak action at 4-5-ish is slightly less
Paul Martin
@Spazholio
Jul 01 2016 22:00
I don’t really know those either. I have guesses, but nothing solid. But my gut was saying lower the basals from 2-4pm, then resume my usuals.
Ben West
@bewest
Jul 01 2016 22:00
usually it's 90 minutes or so to peak action
so I'd go with 3pm or so with slightly less, and maybe also consider tweaking target
if your afternoon is stable, it's probably fine, but be aware it may affect lunch's post-prandials, or even eating soon-mode for dinner
since you'll be getting slightly less, it'll affect the events on either side as well
Paul Martin
@Spazholio
Jul 01 2016 22:01
I do eating soon mode for dinner, usually.
Ben West
@bewest
Jul 01 2016 22:01
so it'd might also be worth looking at targets as a fine sculpting tool
cdaccarett
@cdaccarett
Jul 01 2016 22:02
The dexcom_reader and pyserial are now up-to-date tried to run the openaps use cgm oref0_glucose --no-raw -n 1 --hours 2 command and i still get [] returned
Ben West
@bewest
Jul 01 2016 22:02
hmmm
and it does in fact have data?
openaps use cgm iter_glucose 20 | tee glucose.json
actually
hehe
cdaccarett
@cdaccarett
Jul 01 2016 22:03
They weren't up-to-date before the sudo command though
Ben West
@bewest
Jul 01 2016 22:03
openaps use cgm iter_glucose 20 | openaps use cgm oref0_glucose --no-raw --glucose -
cdaccarett
@cdaccarett
Jul 01 2016 22:04
That works too
Ben West
@bewest
Jul 01 2016 22:08
well, I'm not sure why oref0_glucose isn't working for your g5
usually the --no-raw makes it work... it's a new one, so it's likely there may be a bug somewhere in handling the args or maybe some version tohing
I'd do one report for the raw glucose
and then another report for oref0_glucose --no-raw --glucose glucose-report.json
it works when given the glucose data from file, so that's a potential workaround
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 22:14
@Spazholio @bewest pardon the interrupt; what's the purpose of the remainder field in the reports ?
Paul Martin
@Spazholio
Jul 01 2016 22:15
Confusion, frustration, and tears as far as I’ve found.
=)
But I’mma let @bewest give you a real answer for that one, beacuse I think I kinda get it, but not enough to explain it. =)
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 22:16
lol
I can be the rubber duck here.
Ben West
@bewest
Jul 01 2016 22:17
hmmm
let us consider the humble echo tool
let's say we're going to build an openaps version for the echo tool
our version will say "hello world" and then a name passed in as an argument
so the "command" is echo
the initial, known arguments to the tool are hello world
but it can take additional arguments as well
we don't know what they are, but they'll be provided in the remainder of the arguments
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 22:21
so you've aliased echo to echo "hello world" $somevar
ah so more like xargs than somevar.
Ben West
@bewest
Jul 01 2016 22:22
more like xargs
remainder is all the stuff at the end you can give a report
that isn't defined in the device
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 22:22
nice
thanks
Ben West
@bewest
Jul 01 2016 22:23
$ oref0 device-helper hi 'echo hello world: $*' | openaps import 
process://hi/bash/-c "echo hello world: $*" --
 openaps use --format text hi shell --not-json-default hi test
hello world: hi test
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 22:24
ah! that's the new ns-status
Ben West
@bewest
Jul 01 2016 22:24
if you look at the nightscout shell code and recipes, they're all using device-helper now :-)
same with oref0 template
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 22:25
I haven't even begun to dig into the oref0 rabbit hole. :)
Ben West
@bewest
Jul 01 2016 22:25
here:
cdaccarett
@cdaccarett
Jul 01 2016 22:25
@bewest can you help me with the work around for the raw-glucose ? not really sure what you meant
Ben West
@bewest
Jul 01 2016 22:25
$ openaps report add example-hi.txt  text hi shell --not-json-default hi test
added hi://text/shell/example-hi.txt
bewest@bewest-MacBookPro:~/Documents/loop-new-style$ ^C
bewest@bewest-MacBookPro:~/Documents/loop-new-style$ openaps report show example-hi.txt --ini
[report "example-hi.txt"]
device = hi
remainder = hi test
use = shell
json_default = False
reporter = text
see how remainder is the "rest of the args for the device" defined at report
@cdaccarett make first report do iter_glucose since that works
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 22:27
got it. I've been in copy paste mode for some of this.
cherry picking between dev and master
oh, btw, I really like the additional openaps use examples along with the openaps add you've been documenting lately. They provide insight into what the tool does and not just adding the command to the ini.
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 22:40
so my time is still totally off for NS.
pi@raspberrypi:~/openaps-20160611/my_openaps $ openaps use ns shell get treatments.json 'count=1'
[
  {
    "_type": "TempBasal",
    "temp": "absolute",
    "_description": "TempBasal 2016-07-01T10:51:22 head[2], body[1] op[0x33]",
    "timestamp": "2016-07-01T10:51:22+00:00",
    "_body": "00",
    "_head": "3300",
    "rate": 0,
    "_id": "5776f1142ac0a07cf6611fcf",
    "created_at": "2016-07-01T22:39:16.561Z",
    "_date": "56f30a4110"
  }
]pi@raspberrypi:~/openaps-20160611/my_openaps $ date
Fri Jul  1 15:39:44 PDT 2016
pi@raspberrypi:~/openaps-20160611/my_openaps $ head -20 foo
[
  {
    "_type": "TempBasalDuration",
    "_description": "TempBasalDuration 2016-07-01T14:41:32 head[2], body[0] op[0x16]",
    "timestamp": "2016-07-01T14:41:32+00:00",
    "_body": "",
    "_head": "1601",
    "duration (min)": 30,
    "_date": "60e90e4110",
    "created_at": "2016-07-01T22:39:16.546Z"
  },
  {
    "_type": "TempBasal",
    "temp": "absolute",
    "_description": "TempBasal 2016-07-01T14:41:32 head[2], body[1] op[0x33]",
    "timestamp": "2016-07-01T14:41:32+00:00",
    "_body": "00",
    "_head": "332f",
    "rate": 1.175,
    "_date": "60e90e4110",
```
foo is the output of
 ns-upload $NIGHTSCOUT_HOST $API_SECRET treatments.json monitor/pumphistory-zoned.json
so I sent off treatments, but NS doesn't show them as received.
my created at is in UTC while my timestamp is in PDT. hmm
Ben West
@bewest
Jul 01 2016 22:47
what does date say?
hmmm
take a look at the ns device, see nightscout ns help for help
are you trying to upload pump data to NS treatments?
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 22:48
yeah
Ben West
@bewest
Jul 01 2016 22:48
first step is to get it zoned, which you have
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 22:48
right, my times are just off somehow
Ben West
@bewest
Jul 01 2016 22:48
then it's a two step process:
1.) is reformat the data for NS
2.) is upload it
what does date say?
if you run date
I'm betting it's in UTC on your system
openaps use ns shell format-recent-history-treatments monitor/pump-history.json model.json
openaps use ns shell upload-non-empty-treatments nightscout/recent-treatments.json
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 22:49
$ date
Fri Jul  1 15:49:22 PDT 2016
Ben West
@bewest
Jul 01 2016 22:49
these are the two uses to go with those two steps
ah, let's look at your pump-history-zoned.json then
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 22:50
pi@raspberrypi:~/openaps-20160611/my_openaps $ head -20 monitor/pumphistory-zoned.json
[
  {
    "_type": "TempBasalDuration",
    "_description": "TempBasalDuration 2016-07-01T15:26:28 head[2], body[0] op[0x16]",
    "timestamp": "2016-07-01T15:26:28-07:00",
    "_body": "",
    "_head": "1601",
    "duration (min)": 30,
    "_date": "5cda0f4110"
  },
  {
    "_type": "TempBasal",
    "temp": "absolute",
    "_description": "TempBasal 2016-07-01T15:26:28 head[2], body[1] op[0x33]",
    "timestamp": "2016-07-01T15:26:28-07:00",
    "_body": "00",
    "_head": "332f",
    "rate": 1.175,
    "_date": "5cda0f4110"
Ben West
@bewest
Jul 01 2016 22:51
yeah, that's PDT
openaps use ns shell format-recent-history-treatments monitor/pump-history.json model.json should print out slightly different format for things, but with same zone
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 22:54
pi@raspberrypi:~/openaps-20160611/my_openaps $ openaps use ns shell format-recent-history-treatments monitor/pumphistory.json model.json
[
  {
    "raw_rate": {
      "_type": "TempBasal",
      "temp": "absolute",
      "_description": "TempBasal 2016-07-01T15:46:28 head[2], body[1] op[0x33]",
      "timestamp": "2016-07-01T15:46:28",
      "_body": "00",
      "_head": "332f",
      "rate": 1.175,
      "_date": "5cee0f4110"
    },
    "raw_duration": {
      "_type": "TempBasalDuration",
      "_description": "TempBasalDuration 2016-07-01T15:46:28 head[2], body[0] op[0x16]",
      "timestamp": "2016-07-01T15:46:28",
      "_body": "",
      "_head": "1601",
      "duration (min)": 30,
      "_date": "5cee0f4110"
Ben West
@bewest
Jul 01 2016 22:56
yeah you can save that as a report, and then use upload-non-empty-treatments to upload it
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 22:56
let me give that a shot
great, that got me boluses!
on NS, what causes a value to show up in the basal area? I see them sometimes, but not others.
and thanks for the help
Ben West
@bewest
Jul 01 2016 22:59
it should be there, it's part of that same step
pump-history contains everything the pump does including temp basals and boluses
so it's both getting uploaded in that step
not sure that looks quite right
how come it's zoned in your pump-history but not in the resulting treatments?
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 23:02
"the resulting treatments?"
Ben West
@bewest
Jul 01 2016 23:02
do you have a monitor/pumphistory.json vs monitor/pumphistory-zoned.json?
make sure your using the zoned version
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 23:02
yes I do
Ben West
@bewest
Jul 01 2016 23:02
the last output your showed was not zoned
ah k,
make sure you use the zoned version
in your last example: openaps use ns shell format-recent-history-treatments monitor/pumphistory.json model.json the pump history is not zoned and it should be
this step is creating/formatting the treatments as a result to upload
once you've got pump history zoned, you always want to use the zoned version
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 23:04
ok
Ben West
@bewest
Jul 01 2016 23:04
that's one reason I keep it out of monitor directory, to keep the unzoned version out of sight, and less tempting to use
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 23:04
[report "monitor/pumphistory-zoned.json"]
use = rezone
reporter = JSON
astimezone = Falso
date = timestamp dateString start_at end_at created_at
adjust = missing
input =monitor/pumphistory.json
device = tz
timezone = PDT

[report "nightscout/recent-treatments.json"]
oper = format-recent-history-treatments
use = shell
reporter = JSON
json_default = True
device = ns
remainder = monitor/pumphistory.json model.json
I've got those two and have been using them.
Ben West
@bewest
Jul 01 2016 23:05
so ti should be: openaps use ns shell format-recent-history-treatments monitor/pumphistory-zoned.json model.json
you can just add it as report again
Ed Nykaza
@ed-nykaza
Jul 01 2016 23:07
I believe I am up to speed on the logic behind the temp basal suggestion (in enact/suggested.json). Before I pull the trigger and take the next step of automating the loop, I thought I would ask for a sanity check. I believe that the last step I need to take is to create an alias that runs all of the actions (below) in one command, and then I need to set up a cron job. Here are the commands I have been manually inputting during the testing phase. Please let me know if anything looks wrong or if I am missing some steps: - $ rm -f monitor/ enact/
  • $ openaps get-profile
  • $ openaps monitor-pump
  • $ openaps monitor-cgm
  • $ openaps report invoke enact/suggested.json
  • $ openaps use pump set_temp_basal enact/suggested.json
Ben West
@bewest
Jul 01 2016 23:11
there's a lot of reports and aliases that can be imported from oref0 template mint reports oref0-inputs, oref0 template mint reports medtronic-pump and oref0 template mint alias common
there's also an example repo https://github.com/bewest/openaps-example
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 23:12
hmm. no bueno
pi@raspberrypi:~/openaps-20160611/my_openaps $ openaps report invoke nightscout/recent-treatments.json
ns://JSON/shell/nightscout/recent-treatments.json
reporting nightscout/recent-treatments.json
pi@raspberrypi:~/openaps-20160611/my_openaps $ openaps use ns shell format-recent-history-treatments monitor/pumphistory-zoned.json model.json
[]
```
Ben West
@bewest
Jul 01 2016 23:12
that's expected
you don't (yet) have any newer treatments than the ones you just did...
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 23:13
ah I was wondering if format-recent-history-treatments was doing more than just formatting.
Ben West
@bewest
Jul 01 2016 23:13
it's also hitting ns to check for recency
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 23:13
it's the recent that got me
:)
very cool. thank you Ben.
Ben West
@bewest
Jul 01 2016 23:18
btw, you can do report show --cli to get the corresponding use back out
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 23:24
picked that one up from a conversation between you and @Spazholio, thanks!
which are pretty interesting (distracting :) ) to read.
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 23:36
ok, so @bewest upload treatments with this method does not replace the old report upload-status followed by and ns-upload, correct? Does format-recent-history-treatments conflict with any of the reports in upload-status?
[report "monitor/upload-status.json"]
suggested = enact/suggested.json
status = monitor/status.json
use = shell
reservoir = monitor/reservoir.json
reporter = JSON
battery = monitor/battery.json
clock = monitor/clock.json
json_default = True
device = ns-status
remainder =
iob = monitor/iob.json
enacted = enact/enacted.json
Ben West
@bewest
Jul 01 2016 23:37
ns shell status does what ns-status does
reports don't interfere with each other
to upload, yeah, use openaps use ns shell upload devicestatus.json monitor/upload-status.json
Kim St. Dennis
@kimstdennis_twitter
Jul 01 2016 23:38
ok cool. thanks.
ah. devicestatus.json is the endpoint.