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

3rd
Oct 2015
Peter Miller
@ochenmiller
Oct 03 2015 14:03
Another 12 hour stretch with the loop including time around the house and sleeping. It's clear to me that the next items I need to conquer are range and portability! Other than that things are going really well. Current algorithm responds quite well to uncomped, unacknowledged, snacks as big as 30carbs with only a short excursion out of range.
Chris Oattes
@cjo20
Oct 03 2015 14:12
what are you counting as "out of range"?
Peter Miller
@ochenmiller
Oct 03 2015 14:16
@cjo20 For us it's above 150.
Daytime target is 100. Nighttime 120.
Small sample set so far, but time out of range on the 30 carbs was about 2 hours. That gives me a lot of hope that with some fine tuning, and pre warning we could go even better.
Scott Leibrand
@scottleibrand
Oct 03 2015 14:27
Nice. We didn't really design the system to deal with meal carbs, so you're always going to do better if you actually bolus for carbs, but glad to hear it's eventually brining you back in range. :-)
Peter Miller
@ochenmiller
Oct 03 2015 14:33
What I haven't done yet is determine our carb absorption rate. I recall an article on that about a year back - assume it was from Dana and Scott?
Scott Leibrand
@scottleibrand
Oct 03 2015 14:34
Yep. But we decided to design our openaps implementation to ignore carbs: if just does a "bolus snooze" instead.
So if your DIA is 4h, it will go "hands off" after a bolus by widening the predicted range for the excursion that might be coming, and gradually narrowing it back to zero and taking over again over the next 2h.
It decays the "bolus IOB" for snooze purposes at 2x the DIA rate, so after 1/2 of DIA it considers the remaining bolus IOB the same as basal IOB, and does whatever is appropriate at that point based on BG and net IOB
I wish I had a simpler detailed explanation of how bolus snooze works: hopefully that is clear.
Peter Miller
@ochenmiller
Oct 03 2015 14:41
I confess I'm still diagramming the logic in determine-basal.js. There's a lot packed in there!
Peter Miller
@ochenmiller
Oct 03 2015 14:50
@scottleibrand that explanation makes perfect sense. I like that method of hand off between bolused insulin and return to "responsive" basal manipulation. It kind of matches the intuitive math you do on a missed meal bolus.
Scott Leibrand
@scottleibrand
Oct 03 2015 14:53
Yeah, and it also matches fairly well what DIYPS would do based on actually knowing about the carbs.
As you work on understanding determine-basal.js, it would also be super helpful if you could add some missing init test cases for the corner cases that aren't obvious at first glance.
Peter Miller
@ochenmiller
Oct 03 2015 15:08
@scottleibrand , I will definitely keep that in mind. And, if I haven't made it clear already, HUGE tip of the hat to you Dana, Ben, and everyone else who have forged the path here.
Scott Leibrand
@scottleibrand
Oct 03 2015 15:11
Thanks. It couldn't have happened without all of Ben's work.
Jason Calabrese
@jasoncalabrese
Oct 03 2015 16:53
got the stuck carelink stick that needed to be unplugged to be fixed again
guess we need a way to turn off power to that usb port
going to try putting it under Andrew's bed tonight to see how the range works
Scott Leibrand
@scottleibrand
Oct 03 2015 17:01
@jasoncalabrese: openaps-js has a fix-dead-carelink script that cycles power to USB devices (both wifi and Dexcom, and presumably Carelink as well, since it fixes dead Carelink sticks) on my particular Pi hardware. have you tried it on yours?
my loop.sh calls it whenever it detects that it's unable to do a scan of the Carelink stick, which always seems to fix it for me.
Jason Calabrese
@jasoncalabrese
Oct 03 2015 17:03
didn't even see that...
is there anything like an onerror or retry with invoke
Scott Leibrand
@scottleibrand
Oct 03 2015 17:07
hmm, looks like @bewest's attempt to merge openaps-js master into dev blew away a whole bunch of my changes: openaps/openaps-js@b45b450
I think I'm gonna have to create a branch to preserve Ben's work, and then reset dev back to the prior commit
Chris Oattes
@cjo20
Oct 03 2015 17:15
@jasoncalabrese I've had my pump that I'm pulling CGM data from resting on the side of the bed, and my pi on the floor on the other side of the bedside table, and I haven't had any problems reading data from it
Jason Calabrese
@jasoncalabrese
Oct 03 2015 17:20
@scottleibrand you're going to do a force push? those always cause problems
Scott Leibrand
@scottleibrand
Oct 03 2015 17:20
trying to figure out if I can re-merge properly
Jason Calabrese
@jasoncalabrese
Oct 03 2015 17:21
should be able to revert
Scott Leibrand
@scottleibrand
Oct 03 2015 17:21
maybe I can revert only on loop.sh: looks like all the other stuff he did was fine
Jason Calabrese
@jasoncalabrese
Oct 03 2015 17:22
that would make sense since I don't think he's using loop.sh
Scott Leibrand
@scottleibrand
Oct 03 2015 17:22
and I actually want to pull loop.sh out of this repo anyway
so maybe I can just do that directly
Jason Calabrese
@jasoncalabrese
Oct 03 2015 17:22
where would it go?
an other repo
?
Scott Leibrand
@scottleibrand
Oct 03 2015 17:23
probably a repo of mine instead of under openaps-js
ben feels very strongly that it doesn't belong there
Jason Calabrese
@jasoncalabrese
Oct 03 2015 17:23
I like the declarative style of only using the .ini file
but need to a way to handle errors, etc
Scott Leibrand
@scottleibrand
Oct 03 2015 17:24
yeah, he's been working on some of that, but it's not all the way there yet
he showed me how to create a single device to handle all the openaps-js scripts, and chain together error-checking etc.
Jason Calabrese
@jasoncalabrese
Oct 03 2015 17:25
also been talking to @MilosKozak about getting temp basals into NS, careport and openaps
scottleibrand @scottleibrand is looking forward to that
Jason Calabrese
@jasoncalabrese
Oct 03 2015 17:27
I'm thinking treatments that look a lot like pump history
then we can read pump history and use it and the treatments that same way after merging
Scott Leibrand
@scottleibrand
Oct 03 2015 17:27
yeah
Milos Kozak
@MilosKozak
Oct 03 2015 17:28
We're missing basal handling in ns so it´s next step
Jason Calabrese
@jasoncalabrese
Oct 03 2015 17:31
with the pump history canceling a temp is a new history item with duration of 0 and 0 units
but with the pump history there are 2 items
  {
    "_type": "TempBasalDuration", 
    "duration (min)": 0, 
    "_description": "TempBasalDuration 2015-10-03T10:19:11 head[2], body[0] op[0x16]", 
    "timestamp": "2015-10-03T10:19:11", 
    "_body": "", 
    "_head": "1600", 
    "_date": "8b930a430f"
  }, 
  {
    "_type": "TempBasal", 
    "temp": "absolute", 
    "_description": "TempBasal 2015-10-03T10:19:11 head[2], body[1] op[0x33]", 
    "timestamp": "2015-10-03T10:19:11", 
    "_body": "00", 
    "_head": "3300", 
    "rate": 0.0, 
    "_date": "8b930a430f"
  },
Scott Leibrand
@scottleibrand
Oct 03 2015 17:33
we could just add duration to the TempBasal record in treatments
Jason Calabrese
@jasoncalabrese
Oct 03 2015 17:33
but the running the through Nate's mmhistorytools it gets combined
yeah
Scott Leibrand
@scottleibrand
Oct 03 2015 17:34
and have a really simple pre-process step that combines them. yeah, like that.
Jason Calabrese
@jasoncalabrese
Oct 03 2015 17:34
thinking the treatments are more like the output of mmhistorytools
Scott Leibrand
@scottleibrand
Oct 03 2015 17:34
we don't want to do everything mmhistorytools does, though
in particular, the stuff it does at the beginning and end of a window with suspend events
that is appropriate for point-in-time processing, but not for storing an authoritative master record
Jason Calabrese
@jasoncalabrese
Oct 03 2015 17:36
I think the medtronic entries would get converted at run time to TempBasal treatements
also need to consider combo boluses for NS
duration would be similar
then need to figure out how to add that to the iob calculations
also think we should be uploading some pi/pump status info to the NS devicestatus collection
then we can monitor battery, network, etc
Milos Kozak
@MilosKozak
Oct 03 2015 17:40
duration key is missing in treatments anyway
Scott Leibrand
@scottleibrand
Oct 03 2015 17:40
yeah
Milos Kozak
@MilosKozak
Oct 03 2015 17:41
is the real situation that combo bolus is converted to temp basal?
generaly
Scott Leibrand
@scottleibrand
Oct 03 2015 17:43
I'm not sure how medtronic represents it internally
Milos Kozak
@MilosKozak
Oct 03 2015 17:49
i've been thinking about iob,cob implementation in situation when i add for example 1h basal to bolus and suspend basal for 1h. so far best solution i've found is to implement something like "carbs basal" as an opposite to insulin basals. in normal sutuation insulin basal should cover "carb basal". and when you start lowering insulin temp basals you get some overhead of carb basal leading to BG increase
Scott Leibrand
@scottleibrand
Oct 03 2015 17:50
for openaps, I use what I call a "bolus snooze" algorithm, that calculates bolus IOB separately from net IOB
scroll up to 6h ago to see my description of how that works
Jason Calabrese
@jasoncalabrese
Oct 03 2015 17:58
just entered one, i'll see what it looks like in the pumphistory
Milos Kozak
@MilosKozak
Oct 03 2015 18:01
@scottleibrand you don't play with cob anymore??
Jason Calabrese
@jasoncalabrese
Oct 03 2015 18:02
I only see this for a 1U combo 50%/50% over 1 hour:
 {
    "programmed": 0.5, 
    "_type": "Bolus", 
    "type": "normal", 
    "_description": "Bolus 2015-10-03T10:55:54 head[4], body[0] op[0x01]", 
    "duration": 0, 
    "timestamp": "2015-10-03T10:55:54", 
    "_body": "", 
    "_head": "01050500", 
    "amount": 0.5, 
    "_date": "b6b78a030f"
  }
Scott Leibrand
@scottleibrand
Oct 03 2015 18:02
@MilosKozak not for OpenAPS; only for DIYPS
Jason Calabrese
@jasoncalabrese
Oct 03 2015 18:02
don't know what will show for the other .5U
Scott Leibrand
@scottleibrand
Oct 03 2015 18:03
interesting: it doesn't show that there's an extended bolus scheduled?
Milos Kozak
@MilosKozak
Oct 03 2015 18:05
must be logged somehow. maybe it appears later
Jason Calabrese
@jasoncalabrese
Oct 03 2015 18:05
maybe I'll see some little boluses
had to swap the pump battery, looks like the combo is still going
thats nice coming from the ping
Ben West
@bewest
Oct 03 2015 18:06
@scottleibrand we should probably walk through your intentions with openaps-js so you introduce merge conflicts
don't, also
Scott Leibrand
@scottleibrand
Oct 03 2015 18:07
gonna keep all the .sh stuff there and make openaps-js purely the js stuff
so I won't need to modify your commit at all, just git rm the .sh stuff once I have it all moved over
openaps-sh started as a clone of openaps-js, but I'm removing all the js stuff from it
that way full history is preserved
Ben West
@bewest
Oct 03 2015 18:09
openaps-sh and openaps-js still need proper names
now we have two things with improper names ;-)
Scott Leibrand
@scottleibrand
Oct 03 2015 18:09
yep, dana is working on that part
scottleibrand/openaps-sh is less improper than openaps/openaps-(js|sh) at least
"scott's shell scripts for openaps"
but agreed it needs a new name, among other things, before going back into openaps org
Jason Calabrese
@jasoncalabrese
Oct 03 2015 19:06
got this for the combo later
{
    "programmed": 0.5, 
    "_type": "Bolus", 
    "type": "square", 
    "_description": "Bolus 2015-10-03T10:56:12 head[4], body[0] op[0x01]", 
    "duration": 60, 
    "timestamp": "2015-10-03T10:56:12", 
    "_body": "", 
    "_head": "01050502", 
    "amount": 0.5, 
    "_date": "8cb8aa030f"
  }
so very similar looking to a temp, but the type makes it work differently
think we should be careful about making NS treatment event type too magic, but guess it's too late with cage, announcements, etc
Ben West
@bewest
Oct 03 2015 19:09
square is basically same as temp
same with dual wave
dual wave is normal bolus + "square/temp"
the pump's records are an "operational" view of what is going on inside the pump and why
Scott Leibrand
@scottleibrand
Oct 03 2015 19:10
although it looks like the square waves don't show up when first executed, only after they're delivered?
Ben West
@bewest
Oct 03 2015 19:10
right, bolus only show up after done
so they report on what was delivered vs scheduled
eg, if you suspend during a bolus
it'll say it only delivered part of the bolus
Scott Leibrand
@scottleibrand
Oct 03 2015 19:10
but if you're halfway through a huge square wave, there's no way to tell?
Ben West
@bewest
Oct 03 2015 19:10
no, same thing
it'll log that it delivered half the square wave
Scott Leibrand
@scottleibrand
Oct 03 2015 19:11
no, if it hasn't been cancelled yet
Ben West
@bewest
Oct 03 2015 19:11
it'll say "bolusing" in status command
for MM22
Scott Leibrand
@scottleibrand
Oct 03 2015 19:11
ok, but no indication of the amount delivered so far, or scheduled?
Ben West
@bewest
Oct 03 2015 19:11
and temp requests will fail, also
Scott Leibrand
@scottleibrand
Oct 03 2015 19:11
ah
Ben West
@bewest
Oct 03 2015 19:12
because it's in bolus mode
Scott Leibrand
@scottleibrand
Oct 03 2015 19:12
does normal basal get delivered during square bolus mode?
Ben West
@bewest
Oct 03 2015 19:12
yeah
as well as any pre-existing temp
Jason Calabrese
@jasoncalabrese
Oct 03 2015 19:12
strange
Ben West
@bewest
Oct 03 2015 19:13
but temp gets locked
Scott Leibrand
@scottleibrand
Oct 03 2015 19:13
so basically by setting a square or combo bolus, you're turning off openaps until it's done or canceled
unless we program it to cancel it for you
Ben West
@bewest
Oct 03 2015 19:13
yeah, in effect
in order to compensate
we could come up with way to interactively shape/schedule temps
there's a lot of times when square/dual isn't right either
if I'm eating lot of fat/oil/protein, I might want to start dosing in 30 minutes instead of "now"
Jason Calabrese
@jasoncalabrese
Oct 03 2015 19:15
combo's wouldn't make sense when running openaps
Ben West
@bewest
Oct 03 2015 19:15
there's lot of times when I can't figure out how to schedule the right doses...
pump wants to do stuff "right now"
Jason Calabrese
@jasoncalabrese
Oct 03 2015 19:16
was thinking of it more for careportal
Ben West
@bewest
Oct 03 2015 19:16
what about when I can pay attention now, but need stuff to happen in next 30 - 45 minutes
right, so go into careportal
and say "shape the curve this way starting in 45 min"
Jason Calabrese
@jasoncalabrese
Oct 03 2015 19:17
just want to make it consistent with temps
Ben West
@bewest
Oct 03 2015 19:17
right, so then openaps would perform square/dual on schedule using temp
Jason Calabrese
@jasoncalabrese
Oct 03 2015 19:17
yeah
Ben West
@bewest
Oct 03 2015 19:17
square is exact same as temp in terms of effect/dosing
Jason Calabrese
@jasoncalabrese
Oct 03 2015 19:17
like telling ilet, etc that you are eating now
Ben West
@bewest
Oct 03 2015 19:18
yeah, similar I guess
I'm dosing to bottom of target ahead of meals
Jason Calabrese
@jasoncalabrese
Oct 03 2015 19:18
whenever I try to do that manually I miss it
don't start the bolus soon enough
Ben West
@bewest
Oct 03 2015 19:19
lot of times I just basal it, too
goal is just to get insulin action tarted
Jason Calabrese
@jasoncalabrese
Oct 03 2015 19:19
guess openaps would start temping, but it wouldn't be enough
Ben West
@bewest
Oct 03 2015 19:19
that way you get the stacked effects
we're basically taking advantage of stacking instead of avoiding it
Jason Calabrese
@jasoncalabrese
Oct 03 2015 19:20
yeah
Ben West
@bewest
Oct 03 2015 19:20
target a little higher
Scott Leibrand
@scottleibrand
Oct 03 2015 19:22
with DIYPS we do a bolus up front, and then if it's gonna be a long/slow meal, do the rest in 0.5U increments later on. DIYPS closed loop, when it knew about carbs, would end up high-temping when DIYPS thought additional insulin was needed...
I haven't worked with it, but from what I've heard it sounds like @loudnate's dosing algorithm works similarly, although it may have a tendency to try to do it as fast as possible up front as soon as the carbs are known
Ben West
@bewest
Oct 03 2015 19:29
yeah, I think what I want is something that helps space it out a bit
"I know there are carbs coming, but it's going to take longer than usual"
Scott Leibrand
@scottleibrand
Oct 03 2015 20:20
It might be sufficient to just wait for the BG rise and let openaps respond with a high-temp.
As long as you do the initial bolus up front, it might be able to handle the tail end fine if max_basal and max_iob are set appropriately.
Ben West
@bewest
Oct 03 2015 21:47
been running into a lot of situations where for whatever reason doing the bolus up front is just too much, too fast
need to come back in 20 - 30 minutes or whatever, or need to wait a bit before the bolus
Scott Leibrand
@scottleibrand
Oct 03 2015 21:48
yeah, we often just reduce the amount of the initial bolus, especially if we've done eating soon / prebolus
Jason Calabrese
@jasoncalabrese
Oct 03 2015 22:03
how do you change the auto off setting on the mdt pumps
it's at 20 hours now
Dana Lewis
@danamlewis
Oct 03 2015 22:04
Utilities, alarm, auto off
I had it at 15 hours before I switched to this old pump for OpenAPS. (Theorizing I might on occasion sleep 12-14 hours but 15 would be extreme)
Ali Mazaheri
@amazaheri
Oct 03 2015 22:05
@bewest had one of those scenarios last night
Jason Calabrese
@jasoncalabrese
Oct 03 2015 22:05
thanks, didn't see those menus
while I'm tests or swapping pumps seems like something that will only get in the way
Ben West
@bewest
Oct 03 2015 22:06
hehe
Dana Lewis
@danamlewis
Oct 03 2015 22:07
Yea. Don't really see a point for it anymore, I have it off now
diabeticgonewild
@diabeticgonewild
Oct 03 2015 23:19
One of my pump trainers said that auto off was one of the worst and pointless settings created.
Dana Lewis
@danamlewis
Oct 03 2015 23:20
I'm sure Ben has opinions on features that top that claim ;) to me it was a poor man's LGS based on time, which only had a small chance of achieving that aim
diabeticgonewild
@diabeticgonewild
Oct 03 2015 23:21
I'm going to take my ADHD medicine so I'm going to be up all night. Going to try to finish off the install script for making a hotspot based off of the Edimax adapter by sometime tomorrow. Of course it needs to be tested and verified multiple times. Kind of irresponsible but I didn't feel well earlier today but I got a lot of sleep.
Yeah Ben is pretty opinionated...
I don't worry about things like dead in bed. Been through too much to be worried about that remote possibility. Of course having a rare autoimmune disease (like I do) that looks virtually the same as diabetes complications is a remote possibility...it's really almost a luck of the draw kind of thing cause a lot of it is so poorly understood.
Chris Oattes
@cjo20
Oct 03 2015 23:46
what are you trying to make a hotspot for?
diabeticgonewild
@diabeticgonewild
Oct 03 2015 23:48
Access Point with no Internet. It "creates one" if no "internet based Wifi" is available, and once an internet based wifi becomes available the access point goes down and connects to that.
Chris Oattes
@cjo20
Oct 03 2015 23:49
for what purpose?
diabeticgonewild
@diabeticgonewild
Oct 03 2015 23:49
The setup is very inconvenient and is a hassle and so we are trying to make an install script
To connect to the Raspberry Pi effectively
Chris Oattes
@cjo20
Oct 03 2015 23:49
with what?
diabeticgonewild
@diabeticgonewild
Oct 03 2015 23:49
With or without internet
An Edimax WiFi adapter
Chris Oattes
@cjo20
Oct 03 2015 23:49
to connect to the raspberry pi effectively with what?
diabeticgonewild
@diabeticgonewild
Oct 03 2015 23:50
A mobile phone
Chris Oattes
@cjo20
Oct 03 2015 23:50
why not create the hotspot on the mobile phone and just set the rpi to connect to that
most mobile os allow that, as far as I know
diabeticgonewild
@diabeticgonewild
Oct 03 2015 23:51
Because the access points sometimes go down and Internet is not always available at all times. We want OpenAPS to be reliable with or without Internet. @danamlewis and @scottleibrand has a setup like this
Ben West
@bewest
Oct 03 2015 23:56
I think dana and scott use their iphones as hotspot
then the pi connects to that
Ali Mazaheri
@amazaheri
Oct 03 2015 23:57
I use hotspot when not running the loop from home, works perfect :)
Ben West
@bewest
Oct 03 2015 23:57
yeah, I took mine out for a spin first time last night :-D
Ali Mazaheri
@amazaheri
Oct 03 2015 23:57
:)
Ben West
@bewest
Oct 03 2015 23:57
think I want openaps on mqtt, just like NS
want NS to be showing if it's online/offline, etc