Skip to content
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

Add upload trend data to support pebble app. #23

Open
TC2013 opened this issue May 12, 2014 · 3 comments
Open

Add upload trend data to support pebble app. #23

TC2013 opened this issue May 12, 2014 · 3 comments

Comments

@TC2013
Copy link

TC2013 commented May 12, 2014

I don't know how to submit suggestions for code changes, so here goes:

In the UpLoadHelper file in the Dexcom Uploader repo, after line 44 add:

            testData.put ("trend", data[i].trend);

In this NightScout repo, in the server.js fiel after line 142 add:

                          obj.trend = element.trend;

These 2 changes get everything working with Jason Calabrese's Pebble CGM app (https://github.com/jasoncalabrese/cgm-pebble), except for the delta, which is currently always outputting "false."

@TC2013
Copy link
Author

TC2013 commented May 12, 2014

Almost forgot... In this repo in the pebble.js file, line 17 needs changed to:

                 obj.trend = element.trend;

@TC2013
Copy link
Author

TC2013 commented May 12, 2014

I emailed Lane D on this last night. Lane would like to make enhancements to the current trend arrow calculations (current done in the Dexcom), so that NightScout assigns the arrow value. I'm not positive, but I think the current calculations go something like (I'm terrible at typing out math with out a rich text editor):

  1. < + or - 1 mg/dL/minute = steady arrow
  2. = + or -1mg/dL/minute < + or -2mg/dL/minute = forty-five up/down

  3. = + or -2mg/dL/minute < + or -3mg/dL/minute = up/down

  4. = + or -3mg/dL/minute = Double Up/Down

@scottleibrand
Copy link

I believe that is correct, based on a 30m trailing average. However, there is more to the Dexcom algorithm than that. For example, if the noise level at the sensor is too high, the Dex will not display a trend arrow. Also, when you recalibrate, the Dexcom arrows maintain the previous trend, in spite of a big calibration jump/drop. If you attempt to do your own trend arrows, it is difficult but necessary to avoid having a calibration throw them off.

IMO it's useful to collect the Dexcom trend arrows and use them as a sanity check on your own trend calculations. We do a rudimentary version of that in #DIYPS now.

Scott

On May 12, 2014, at 5:58 AM, TC2013 [email protected] wrote:

I emailed Lane D on this last night. Lane would like to make enhancements to the current trend arrow calculations (current done in the Dexcom), so that NightScout assigns the arrow value. I'm not positive, but I think the current calculations go something like (I'm terrible at typing out math with out a rich text editor):

  1. < + or - 1 mg/dL/minute = steady arrow
  2. = + or -1mg/dL/minute < + or -2mg/dL/minute = forty-five up/down

  3. = + or -2mg/dL/minute < + or -3mg/dL/minute = up/down

  4. = + or -3mg/dL/minute = Double Up/Down


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants