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

Use Exercise Markers in Prediction #13

Open
channemann opened this issue Sep 4, 2015 · 7 comments
Open

Use Exercise Markers in Prediction #13

channemann opened this issue Sep 4, 2015 · 7 comments

Comments

@channemann
Copy link
Contributor

Much like meal markers are used in combination with the bolus wizard entries for COB analysis, it would be great to use the exercise marker to adjust the prediction. There are many ways to do this, but one is to predict a drop of x mg/dL over y min for each marker that is placed. Perhaps set it at a 1/2 U ISF equivalent or something (all could be user-configurable). When I'm about to bike or something, I can simply add a marker or two on the pump, which will shift the prediction and adjust accordingly. If I'm exercising longer, I can add more markers.

Might only apply to x23 series, not sure.

@loudnate
Copy link
Owner

loudnate commented Sep 4, 2015

This does only apply to x23 and up, but this is still a great feature! You'll need to open a similar feature in https://github.com/loudnate/mmhistorytools so we don't strip the exercise marker. We might also need to make sure https://github.com/bewest/decoding-carelink is parsing them first.

@bewest
Copy link

bewest commented Sep 5, 2015

Good ideas. Are there any samples of data with the desired markers in them with known values?
I'm not sure my mm522 has this feature. Once you've got several desirable markers in a page of memory (and know what times/values to expect in the data) you can capture it with:

export SERIAL=665455; mm-send-comm.py --init sleep 0; mm-send-comm.py tweak ReadHistoryData --save --page 0, and post the resulting ReadHistoryData-page-0.data somewhere (or the hexdump, output from xxd ReadHistoryData-page-0.data).

@channemann
Copy link
Contributor Author

So here is the hexdump:

pi@raspberrypi ~/decoding-carelink $ xxd ReadHistoryData-page-0.data
0000000: 3328 b379 0e44 0f00 1601 b379 0e44 0f33  3(.y.D.....y.D.3
0000010: 00a5 420f 440f 0016 00a5 420f 440f 7b02  ..B.D.....B.D.{.
0000020: a542 0f04 0f10 2400 0a9a 9856 2f64 0f3f  .B....$....V/d.?
0000030: 1398 564f 640f aed7 630a 78ae 562f 640f  ..VOd...c.x.V/d.
0000040: 3f0f ae56 0f64 0fae d763 4000 ba65 0f04  ?..V.d...c@..e..
0000050: 0f01 0141 0081 660f 040f 0040 00b3 6010  ...A..f....@..`.
0000060: 040f 0901 3320 bb60 1044 0f00 1601 bb60  ....3 .`.D.....`
0000070: 1044 0f33 1bb7 6510 440f 0016 01b7 6510  .D.3..e.D.....e.
0000080: 440f 3316 8c73 1044 0f00 1601 8c73 1044  D.3..s.D.....s.D
0000090: 0f33 14ac 7710 440f 0016 01ac 7710 440f  .3..w.D.....w.D.
00000a0: 3300 ba42 1144 0f00 1601 ba42 1144 0f33  3..B.D.....B.D.3
00000b0: 00ae 4711 440f 0016 01ae 4711 440f 3300  ..G.D.....G.D.3.
00000c0: 925c 1104 0f00 1600 925c 1104 0f7b 0292  .\.......\...{..
00000d0: 5c11 040f 1024 001e 01b0 5c11 440f 1f20  \....$....\.D.. 
00000e0: 955d 1144 0f7b 0295 5d11 040f 1024 005b  .].D.{..]....$.[
00000f0: 00ac 4312 640f 2d50 0078 285a 0000 9400  ..C.d.-P.x(Z....
0000100: 0000 0094 785c 1122 77d0 2481 d024 8bd0  ....x\."w.$..$..
0000110: 6e95 d014 c7d0 5b00 af43 1264 0f2d 5000  n.....[..C.d.-P.
0000120: 7828 5a00 0094 0000 0000 9478 5c11 2277  x(Z........x\."w
0000130: d024 81d0 248b d06e 95d0 14c7 d001 004c  .$..$..n.......L
0000140: 004c 0000 01b9 44b2 640f 0100 4800 4800  .L....D.d...H.H.
0000150: 0000 af43 9264 0f00 0000 0000 0000 0000  ...C.d..........
0000160: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000170: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000180: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000190: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001a0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001b0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001f0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000220: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000230: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000240: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000250: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000260: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000270: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000280: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000290: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00002a0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00002b0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00002c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00002d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00002e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00002f0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000300: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000310: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000320: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000330: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000340: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000350: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000360: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000370: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000380: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000390: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00003a0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00003b0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00003c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00003d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00003e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00003f0: 0000 0000 0000 0000 0000 0000 0000 7009  ..............p.

CSV is at:
https://drive.google.com/file/d/0BxtghnXxQO6_eHFvc1MyMkxQN0U/view?usp=sharing
The entry is index 330, at 9/4/2015 3:38:01 PM; JournalEntryExerciseMarker

Of note, the exercise marker is in between two meal markers, which do get decoded correctly.

@bewest
Copy link

bewest commented Sep 7, 2015

Nice. :)

@bewest
Copy link

bewest commented Sep 7, 2015

So, the marker has not numeric value or anything? What do you intend for this to mean, what does the system intend for this to mean, is there any difference? Is it similar to "eating soon mode" in terms of "there's exercise happening... " "already", "now," "soon." for "$duration" minutes? Of intensity $itense?

Can we get this from fitbit or similar? Looks like, if I'm understanding correctly that this is a simple binary marker of "some exercise may or may not be happening."? Any proposed json export for this?

Thanks again, great job, the hexdump is perfect.

@channemann
Copy link
Contributor Author

My use case is along the lines of "I am about to exercise," with each marker counting for a "unit" of exercise. The system would see it, and just like it superimposes carbs and insulin activity into the prediction, it would add it in. There would need to be a user configuration somewhere that specifies the BG equivalency of an "exercise unit" and the duration over which it is applied; for me, I'd probably use something like 20 mg/dL over 15 minutes. If I was going to do intense exercise, I would enter two markers in, one right after the other. If I wanted to do a long exercise, I would have to re-enter this every 15 minutes. That last part isn't ideal, so I'm happy to rethink how to better handle it. You're right that it is simply binary at the pump level, which is unfortunate—a duration entry would be great.

Two different scenarios occurred that made me think this would be a good idea: one was biking home from a bar, where my BG was good but I knew it would drop. If I had entered an exercise marker, the system would have started to adjust earlier instead of waiting until I dropped. The other scenario was a hike that went most of the day. I kept fighting the system, essentially by eating without telling it I was eating. In that case, some way to indicate that I would be doing this for a longer duration would be better.

FitBit data may work, but it would be lagging.

@channemann
Copy link
Contributor Author

opcode = 0x41
body_length = 1

See bewest/decoding-carelink#128

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

3 participants