-
Notifications
You must be signed in to change notification settings - Fork 71.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alarm / Threshold updates (and some other UI updates...) #305
Conversation
…o the server and api
…e get basic settings from api
Do we really want to change the default behavior, and require an ENV variable to restore the previous default? Seems better to only change the alarm type if custom thresholds are defined Scott
|
@scottleibrand I've been trying to decide on that. I think most users expect an alarm below the line on the chart. The easy approach would be to default ALARM_TYPES to |
Also thinking about drawing a line at |
IMO, if a user sets a threshold, it should simply alarm at that threshold unless they specify to predict. If the user does nothing, the current behavior should not change: some people rely on Nightscout "alarming sooner" than Dexcom. Scott
|
I'll go with that for now |
also some cleanup of the int ENV parsing
Where do we need to setup the ENV to use this? On the code env.js or in
|
@raven569 you can set them in the Azure settings, just like the ENV vars used here: http://www.nightscout.info/wiki/labs/cgm-remote-monitor-care-portal |
So have to add all 5 variables?
|
Sot just add ALARM_TYPES and predict in azure yes?
|
All the new settings have a default, so you only need to change the ones you want. For example if you like the default |
I want the 240 and turn off the 180. Code has bottom at 80 not 70? Want the
|
It's probably best to set all the env vars, then you don't have to remember what the defaults are. Notes above were wrong 70 vs 80, thanks for catching it, fixing |
OK so how set all? Just put predict ? Or do u call each one?
|
var lastBG = actual[actualLength].y; | ||
|
||
if (lastBG > env.thresholds.bg_high) { | ||
emitAlarmType = 'urgent_alarm'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not conflate urgent and high.
This should be a high alarm type not urgent, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jason stipulated two high thresholds: a "high end of target range"
threshold (default 180), which would trigger a standard alarm, and a
"urgent high" threshold (default 240) that would trigger an urgent alarm.
Similar on the low end (80 and 55 IIRC).
Does that paradigm make sense to you? Do you have any suggestions for a
better way to approach it?
On Fri, Dec 19, 2014 at 3:56 PM, Ben West notifications@github.com wrote:
In lib/websocket.js
#305 (diff)
:@@ -238,20 +238,42 @@ function loadData() {
emitData( );
}
// compute current loss
var avgLoss = 0;
var size = Math.min(predicted.length - 1, 6);
for (var j = 0; j <= size; j++) {
avgLoss += 1 / size \* Math.pow(log10(predicted[j].y / 120), 2);
var emitAlarmType = null;
if (env.alarm_types.indexOf("simple") > -1) {
var lastBG = actual[actualLength].y;
if (lastBG > env.thresholds.bg_high) {
emitAlarmType = 'urgent_alarm';
Let's not conflate urgent and high.
This should be a high alarm type not urgent, right?—
Reply to this email directly or view it on GitHub
https://github.com/nightscout/cgm-remote-monitor/pull/305/files#r22136552
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was attempting to not change the current normal/urgent alarms levels, since adding extra levels will make snooze more complicated.
There are still issues to work out with the High/Low setting on the client. The easy thing to do is make them say Urgent/Normal, but I don't think thats what people want.
…as yellow and urgent as red; some clean up
@scottleibrand I'm wondering if the default for |
Agreed. Would love to see that! Sent from my iPad
|
I think we need a BG dot for 3 types: calibration, meter(ShugaTrak), and BG check(manual, care portal) Thinking same red dot with different border |
BG checks would be interesting... If they were shown on position of BG
|
I have the code to estimate BG position by time, so we could put everything on the trend line, but I think it could get crowded. Some events like basal and activity make sense at the top. |
@jasoncalabrese Should there be different sized dots for different CP entry types? I see a large dot for a standard meal bolus, medium dots for a split entry (prebolus) and smaller dots for an insulin correction. Edit: Or is the CP dot size related to the amount of carbs / insulin given? |
Yes, the size is relative, it would work even better if it knew the actual carb ratio that was used. |
nice :) |
…re's glucose make it look similar to a calibration
@@ -238,6 +242,11 @@ div.tooltip { | |||
font-size: 70%; | |||
} | |||
|
|||
html body #bgButton { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
html body
is unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, should this be merged with the #bgButton
rule on line 153?
Looking good. |
Added a few comments. Looks good otherwise. |
…ries for a couple of edge cases
@trhodeos thanks for the code review, think I took care of those issues I merged this to my prod branch and will be using it all day tomorrow, if there aren't any new issues I plan to merge tomorrow. |
Alarm / Threshold updates (and some other UI updates...)
Many users don't understand the current Loss/PredictAR based alarms, they also want to be able to set their own target range instead of the default 80-180.
This PR aims to make the target range and alarm types configurable, this should address most of #271. To do this 5 new ENV variables have been added.
BG_HIGH
- default: 260, the high BG outside the target range that is considered urgentBG_TARGET_TOP
- default: 180, the top of the target range, also used to draw the line on the chartBG_TARGET_BOTTOM
- default: 80, the bottom of the target range, also used to draw the line on the chartBG_LOW
- default: 55, the low BG outside the target range that is considered urgentALARM_TYPES
- default to simple if anyBG_
* ENV's are set, otherwise default to predict. There currently 2 alarm types are supported, and can be used independently are separately. Thesimple
alarm type only compares the current BG toBG_
thresholds above, thepredict
alarm type works as before by using a highly tuned formula that forecasts where the BG is going based on it's trend.