Closed sethgagnon closed 1 year ago
I'll leave this open, but you'll have to find a FreeAPSX user who is willing to code this.
OK. Yea, I can see if I can find someone. I took an export of the devicestatus collection entries (one for Loop and one for FreeAPS X, figuring it would be a mapping exercise, more or less. However, that does not seem to be the case :) I can post those two entries here if that makes it easier for someone to edit existing code you have to accommodate the openaps devicestatus?
I'm confused on this ... I too am using FreeAPS X now, and am just checking whether Follow will work for it ...
Right now, all of the data that Seth mentions above is uploaded and visible via Nightscout, so if I have Follow pointing to NIghtscout for all of its data, shouldn't it "just work"? Or does Nightscout just store devicestatus raw in the database and depending on if we have OpenAPS or Loop enabled in settings determines how that data is read in?
To Seth ... can you attach the two devicestatus entries you created so that I can see the difference between the two?
Thx
devicestatus from Loop:
{"_id":{"$oid":"5d4881ec654d4c00043cd9f4"},"uploader":{"name":"Seth's iPhone","timestamp":"2019-08-05T18:52:11Z","battery":{"$numberInt":"52"}},"device":"loop://Seth's iPhone","created_at":"2019-08-05T18:52:11Z","loop":{"cob":{"cob":{"$numberDouble":"7.045680552526177"},"timestamp":"2019-08-05T18:50:00Z"},"recommendedBolus":{"$numberInt":"0"},"name":"Loop","iob":{"timestamp":"2019-08-05T18:50:00Z","iob":{"$numberDouble":"1.2386481303784582"}},"predicted":{"values":[{"$numberInt":"124"},{"$numberInt":"123"},{"$numberInt":"122"},{"$numberInt":"120"},{"$numberInt":"118"},{"$numberInt":"117"},{"$numberInt":"115"},{"$numberInt":"114"},{"$numberInt":"113"},{"$numberInt":"112"},{"$numberInt":"111"},{"$numberInt":"110"},{"$numberInt":"110"},{"$numberInt":"109"},{"$numberInt":"109"},{"$numberInt":"109"},{"$numberInt":"109"},{"$numberInt":"109"},{"$numberInt":"109"},{"$numberInt":"109"},{"$numberInt":"108"},{"$numberInt":"106"},{"$numberInt":"105"},{"$numberInt":"104"},{"$numberInt":"103"},{"$numberInt":"102"},{"$numberInt":"101"},{"$numberInt":"100"},{"$numberInt":"100"},{"$numberInt":"99"},{"$numberInt":"98"},{"$numberInt":"98"},{"$numberInt":"97"},{"$numberInt":"97"},{"$numberInt":"96"},{"$numberInt":"96"},{"$numberInt":"96"},{"$numberInt":"95"},{"$numberInt":"95"},{"$numberInt":"95"},{"$numberInt":"94"},{"$numberInt":"94"},{"$numberInt":"94"},{"$numberInt":"94"},{"$numberInt":"94"},{"$numberInt":"94"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"},{"$numberInt":"93"}],"startDate":"2019-08-05T18:51:57Z"},"enacted":{"duration":{"$numberInt":"30"},"timestamp":"2019-08-05T18:52:11Z","received":true,"rate":{"$numberDouble":"1.6"}},"timestamp":"2019-08-05T18:52:11Z","version":"1.10.0dev-jojo"},"pump":{"clock":"2019-08-05T18:52:11Z","model":"Eros","bolusing":true,"secondsFromGMT":{"$numberInt":"-14400"},"suspended":false,"pumpID":"1F097208","manufacturer":"Insulet"},"override":{"timestamp":"2019-08-05T18:52:11Z","name":"Custom","currentCorrectionRange":{"maxValue":{"$numberInt":"95"},"minValue":{"$numberInt":"95"}},"active":true,"multiplier":{"$numberDouble":"1.3"}}}
seth, can you send me the URL to see this properly formatted? I can be reached privately at:
yscrappy at gmail dot com
You are partially correct in that most of it can be 'mapped' ... I'm going to try on this end to see if I can find someone that is using Loop that I can look at their data but if you can share an existing URL, that might be faster ...
Hi!
FreeAPS X dev branch is now capable of looping with Dexcom directly like in Loop, and is no longer depending on internet connection. With this development, FreeAPS X is suddenly much more appealing for a larger audience than has been the case until now.
Have anyone made progress with making Loop Follow accept oref1 based devicestatus data? We are using LF with Loop, and would be very interested in continuing to do so if/when we move to FreeAPS X. I doubt I have much to offer except testing though.
@scrappy ?
We will be testing FAX during the next few weeks at least, and can help with testing and data if anyone should happen to look into this.
Would there be anything useful in the Nightscout plugin for openAPS in order to map the relevant NS data?
https://github.com/nightscout/cgm-remote-monitor/blob/master/lib/plugins/openaps.js
Yesterday, an IOB upload bug was fixed in FAX dev https://github.com/ivalkou/freeaps/commit/0f8de8274303ec65169ace4f008448168a6a814d
I wonder if that bug may have caused problems during previous attempts to map looping data from oref to match what Loop Follow is expecting.
Perhaps @sethgagnon or @scrappy would have another look at this? It’s probably a good idea to get 24 hours of data from the updated FAX dev into Nightscout before expecting things to work, otherwise there will be a mix of broken and good IOB data.
There might also be something of interest in the Nightguard app code, this is an “ iOS and WatchOS Client for the Nightscout CGM System”, written in Swift. It is compatible with both Loop, FAX and AAPS data.
Here is something possibly relevant, but IOB import could be defined in some other file for all I know.
https://github.com/nightscout/nightguard/blob/master/nightguard/NightscoutData.swift
I can try testing this out. I am running latest dev FAPSX. I will try over the weekend to give it some time to update.
@scrappy did i already send you the files?
I think there was a problem with crashing before, but Loop Follow runs fine with FreeAPS X data now.
IOB and COB are still missing, but basal is drawn in the chart. SAGE and CAGE is picked up from NS as expected.
@bjornoleh What about SMB data does that show up for you? I see the BG, Basal, no IOB or COB but it doesn't show the SMB pills. Any suggestion on what you had to change on the base code to get it to work?
@bjornoleh What about SMB data does that show up for you? I see the BG, Basal, no IOB or COB but it doesn't show the SMB pills. Any suggestion on what you had to change on the base code to get it to work?
Hi @iamscoutwarrior , I haven’t changed any code in LF or FAX. But I also don’t see any bolus/ SMB or carb entries. Only the temp basals are displayed. SAGE and CAGE are Nightscout Careportal entries.
@timwa124 has found a way to get FreeAPS data into Loop Follow. I have tested this now, and as far as I can see, this works.
The proposed changes are explained here: https://github.com/timwa124/LoopFollow#readme
In addition to the above, timwa124 also fixed an issue I ran into due to a patch to FAX for uploading profile data to NS. The fix was to change "store.Default.basal" in LoopFollow/Controllers/NightScout.swift to lowercase (line 836 originally). I dont know if the change should be done in LF or FAX.
The complete changes are summarised here: https://github.com/jonfawcett/LoopFollow/compare/dev...bjornoleh:FAX_patch_timwa124?expand=1#diff-87136dd82b7f6a07881c12334c39552a836a284acc8801aae577762030ad8ac6
This solution is breaking LF with Loop, as collection of Loop data is replaced by FAX data, if I understand this correctly.
Hopefully someone can take this the last mile to bring a solution that works with both FAX and Loop.
This is very straightforward and I will look into incorporating it directy into LF. There’s a chance I can auto-detect it by looking for the loop vs openaps key. Then just set that system wide to switch between my original code and the fax code you wrote. If I’m able to do it, I will need a FAX user to handle maintenance on the dedicated code as needed since I can’t test it.
This is very straightforward and I will look into incorporating it directy into LF. There’s a chance I can auto-detect it by looking for the loop vs openaps key. Then just set that system wide to switch between my original code and the fax code you wrote. If I’m able to do it, I will need a FAX user to handle maintenance on the dedicated code as needed since I can’t test it.
Thanks Jon!
I'm sure about maintenance of the code, but testing is no problem. We'll let you know if anything should get broken at some point in the future.
I would probably like to see a couple of additional parameters in the Information display such as current target (mgdL / mmol) and Sensitivity ratio (oref specific). Possibly some prediction value too, like eventual BG.
Hi Jon,
i could help in this case to keep it up'n running. @bjornoleh: i'm able to post a json output of FAX and if Jon would be able to integrate these, this would be great :)
Best Markus
This would be the JSON Output of my Nightscout Instance Running freeaps-X. I used this to patch your great Loop Follow app! :)
[ -{ ["_id"](): "6227aea31620cf113a50bc22", -["uploader"](): { ["battery"](): 25 }, ["device"](): "freeaps-x://iPhone8", -["preferences"](): { ["remainingCarbsCap"](): 90, ["min_5m_carbimpact"](): 8, ["bolussnooze_dia_divisor"](): 2, ["curve"](): "rapid-acting", ["remainingCarbsFraction"](): 1, ["autosens_min"](): 0.8, ["maxSMBBasalMinutes"](): 30, ["resistanceLowersTarget"](): true, ["high_temptarget_raises_sensitivity"](): false, ["maxUAMSMBBasalMinutes"](): 30, ["unsuspend_if_no_temp"](): false, ["maxCOB"](): 150, ["autosens_max"](): 1.2, ["max_iob"](): 7, ["useCustomPeakTime"](): false, ["skip_neutral_temps"](): false, ["autotune_isf_adjustmentFraction"](): 1, ["enableSMB_after_carbs"](): true, ["enableSMB_always"](): false, ["adv_target_adjustments"](): false, ["max_daily_safety_multiplier"](): 3, ["low_temptarget_lowers_sensitivity"](): false, ["insulinPeakTime"](): 75, ["carbsReqThreshold"](): 1, ["enableUAM"](): true, ["rewind_resets_autosens"](): true, ["current_basal_safety_multiplier"](): 4, ["wide_bg_target_range"](): false, ["sensitivity_raises_target"](): true, ["enableSMB_with_temptarget"](): false, ["allowSMB_with_high_temptarget"](): false, ["noisyCGMTargetMultiplier"](): 1.3, ["half_basal_exercise_target"](): 160, ["suspend_zeros_iob"](): true, ["A52_risk_enable"](): false, ["bolus_increment"](): 0.1, ["SMBInterval"](): 3, ["enableSMB_with_COB"](): true, ["exercise_mode"](): true }, -["openaps"](): { ["version"](): "0.7.0", -["enacted"](): { ["sensitivityRatio"](): 1.2, ["COB"](): 61, ["deliverAt"](): "2022-03-08T19:29:18.659Z", ["insulinReq"](): 0.84, ["temp"](): "absolute", ["timestamp"](): "2022-03-08T19:29:38.897Z", ["reservoir"](): 3735928559, ["units"](): 0.2, -["predBGs"](): { -["ZT"](): [ 144, 127, 110, 93, 77, 61, 46, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39 ], -["IOB"](): [ 144, 143, 140, 136, 132, 126, 119, 111, 102, 93, 82, 70, 58, 46, 39 ], -["COB"](): [ 144, 144, 144, 144, 144, 144, 145, 146, 147, 149, 151, 153, 155, 158, 161, 164, 167, 171, 175, 180, 184, 189, 194, 200, 205, 211, 217, 223, 230, 236, 243, 250, 257, 263, 270, 277, 283, 289, 296, 302, 308, 314, 319, 325, 330, 336, 341, 345 ], -["UAM"](): [ 144, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 125, 123, 122, 121, 120, 119, 117, 116, 114, 113, 111, 109, 106, 104, 101, 98, 96, 93, 91, 89, 88, 86, 85, 84, 83, 82, 81 ] }, ["eventualBG"](): 345, ["bg"](): 144, ["reason"](): "COB: 61, Dev: 104, BGI: -17, ISF: 90, CR: 8.9, Target: 99, minPredBG 175, minGuardBG 122, IOBpredBG 39, COBpredBG 345, UAMpredBG 81; Eventual BG 345 >= 99, insulinReq 0.84; maxBolus 0.2; setting 60m low temp of 0U/h. Microbolusing 0.2U. ", ["IOB"](): 4.022, ["duration"](): 60, ["rate"](): 0, ["recieved"](): true }, -["iob"](): { ["bolusinsulin"](): 9.6, ["time"](): "2022-03-08T19:28:45.628Z", ["lastBolusTime"](): 1646767533319, ["iob"](): 4.022, ["activity"](): 0.0386, -["lastTemp"](): { ["date"](): 1646767528519, ["started_at"](): "2022-03-08T19:25:28.519Z", ["timestamp"](): "2022-03-08T19:25:28.519Z", ["duration"](): 4.29, ["rate"](): 0 }, ["netbasalinsulin"](): -1.6, ["bolusiob"](): 4.909, ["basaliob"](): -0.887, -["iobWithZeroTemp"](): { ["bolusinsulin"](): 9.6, ["time"](): "2022-03-08T19:28:45.628Z", ["iob"](): 4.022, ["activity"](): 0.0386, ["netbasalinsulin"](): -1.6, ["bolusiob"](): 4.909, ["basaliob"](): -0.887 } }, -["suggested"](): { ["sensitivityRatio"](): 1.2, ["COB"](): 61, ["deliverAt"](): "2022-03-08T19:29:18.659Z", ["insulinReq"](): 0.84, ["temp"](): "absolute", ["timestamp"](): "2022-03-08T19:29:18.659Z", ["reservoir"](): 3735928559, ["units"](): 0.2, ["eventualBG"](): 345, ["bg"](): 144, ["reason"](): "COB: 61, Dev: 104, BGI: -17, ISF: 90, CR: 8.9, Target: 99, minPredBG 175, minGuardBG 122, IOBpredBG 39, COBpredBG 345, UAMpredBG 81; Eventual BG 345 >= 99, insulinReq 0.84; maxBolus 0.2; setting 60m low temp of 0U/h. Microbolusing 0.2U. ", ["IOB"](): 4.022, ["duration"](): 60, ["rate"](): 0 } }, -["pump"](): { ["clock"](): "2022-03-08T19:29:40.843Z", -["battery"](): { ["percent"](): 100, ["string"](): "normal", ["display"](): false }, -["status"](): { ["status"](): "bolusing", ["timestamp"](): "2022-03-08T19:29:32.643Z", ["bolusing"](): true, ["suspended"](): false } }, ["created_at"](): "2022-03-08T19:29:39.788Z", ["utcOffset"](): 60, ["mills"](): 1646767779788 },
Hey @jonfawcett wondering if you wound up incorporating this or not.
No. I never had time to deal with it and at this point I am not pursuing any further development of loop follow except breaking changes due to iOS updates. This decision came because there is no viable path to the App Store with the current method or any other reliable workarounds for background alerts. So I am focused solely on a ground up new app with similar features but to utilize push notifications for alerts in the background.
I've made a bit of progress with this, though I don't think I have it all perfect and I'm sure it could be improved.
For instance, I see a discrepancy between the reported eventual number under the timer and the Eventual BG data in the stats pane. I have also made some decisions on my own about which prediction set to use (UAM if available, else COB if available, else IOB if available, else ZT) and I am not certain if I made the best decisions here.
I changed some of the data in stats (for instance, instead of Override I am showing the Autosens adjustment value), implemented the above noted graph logic (graphing all prediction lines would be better, I haven't gotten there yet though), and did some work to update how overrides show up in the view (closer to Loop Classic) - some work to be done with this though to show what the override targets are. Lastly, I'm not sure about that eventual vs predicted BG that I noted.
If there is interest by others in looking at this, I'm happy to share - though I also recognize and respect that Jon's path forward is not on Loop Follow and ultimately I think the next tool from Jon will be the best option (assuming it supports OpenAPS systems as well as Loop Classic).
Added a history view for when basal was actually on - it so happens that in the above image we haven't needed basal for quite a while so it doesn't show up.
Thanks! Great if you can keep a branch available with your changes, so others can pick or merge.
ons. 28. sep. 2022 kl. 16:10 skrev Auggie @.***>:
I've made a bit of progress with this, though I don't think I have it all perfect and I'm sure it could be improved.
For instance, I see a discrepancy between the reported eventual number under the timer and the Eventual BG data in the stats pane. I have also made some decisions on my own about which prediction set to use (UAM if available, else COB if available, else IOB if available, else ZT) and I am not certain if I made the best decisions here.
I changed some of the data in stats (for instance, instead of Override I am showing the Autosens adjustment value), implemented the above noted graph logic (graphing all prediction lines would be better, I haven't gotten there yet though), and did some work to update how overrides show up in the view (closer to Loop Classic) - some work to be done with this though to show what the override targets are. Lastly, I'm not sure about that eventual vs predicted BG that I noted.
If there is interest by others in looking at this, I'm happy to share - though I also recognize and respect that Jon's path forward is not on Loop Follow and ultimately I think the next tool from Jon will be the best option (assuming it supports OpenAPS systems as well as Loop Classic).
[image: image] https://user-images.githubusercontent.com/659845/192801311-1c707302-ee65-4088-a12a-d87880e2a508.png
— Reply to this email directly, view it on GitHub https://github.com/jonfawcett/LoopFollow/issues/134#issuecomment-1260974381, or unsubscribe https://github.com/notifications/unsubscribe-auth/APEZWM2DZMEWHK65GCKSRMDWARGUHANCNFSM45PSZJHQ . You are receiving this because you were mentioned.Message ID: @.***>
https://github.com/aug0211/aug0211-LoopFollowFAX/tree/fax
Solution above 👆
I know this issue is marked as closed, but it would still be nice to get proper support for iAPS (previously known as FreeAPS X / FAX). Auggies branch above now has a number of merge conflicts with Loop Follow main, so it is difficult to bring in the latest changes. It also breaks the support for Loop. Is there anyone who would be able to work on getting iAPS support included in Loop follow main branch?
tagging @bjorkert in case comments to this this closed issue goes undetected otherwise :-)
Hi! Thanks for the ping. Let's re-open this one. This is already on my to-do list, I have some iAPS nightscout accounts to test with.
That's great! Thanks!
iAPS Support is now implemented using code from Auggie's fork.
Requesting that Loop Follow incorporate the ability to read in devicestatus from oref algo for use with FeeAPS X. This will allow for proper COB, IOB, etc display for FreeAPS X users.