nightscout / trio Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
In Nightscout, delta values are interpolated to 5 min interval values when recent SGV values are missing. This is giving more realistic delta values. It would be nice to have this incorporated in OiAPS as well
I believe the NS code for this is here:
https://github.com/nightscout/cgm-remote-monitor/blob/46418c7ff275ae80de457209c1686811e033b5dd/lib/plugins/bgnow.js#L164
This is with alpha branch.
I believe the OpenAPS pill should indicate last time loop enacted and go yellow at 30 minutes since last time it successfully enacted. (That's what happens with iAPS implementation).
The OpenAPS pill (with alpha) shows the last time any upload happened including Not Enacted.
See thread in discord:
These are nits - just providing this list so they are available for update when and if desired.
I am testing only alpha branch (soon to be dev).
Configuration: commit 99effeb
This is a plist file so a little different:
<string>com.artificial-pancreas-iaps</string>
The rest of these are in *.swift files and indicate the line numbers where hard-coded "iAPS" exists:
StateiAPSResults
, see next file)Note: many of the rest of these should (later) be modified to use appName instead of hard coded string
Hard-coded string from iAPS to Open-iAPS
Hard-coded string from FAX to Open-iAPS
Describe the bug
due to this line the oref functionality resistance_lowers_target
does not work as it is always false
To Reproduce
Steps to reproduce the behavior:
Expected behavior
target need to be lower than profile target
Solution
case resistanceLowersTarget = "resistance_lowers_target"
in preferences.swift (see above)
With the #93 the model PumpHistoryEvent is modified to add external insulin Type and a isExternalInsulin boolean :
struct | type |
---|---|
![]() |
![]() |
However, when a external insulin is added with the interface, only the externalInsulin bool is defined to true (the type = bolus and no externalInsulin) :
I also found a function never used by any code where isExternalInsulin = true
The externalInsulinType is used by NS (and only by NS) to build a nightscoutTreatement object with a function to deduce the type : https://github.com/nightscout/Open-iAPS/blob/8ebd52a69612977cf705c5843d71250eb23bb009/FreeAPS/Sources/APS/Storage/PumpHistoryStorage.swift#L260
My proposal will be to remove the externalInsulin Type in Event Type and create a specific type enum for NS, avoid to have inconsistent between type and isExtrernalInsulin attribue.
Describe the bug
In the pop-up pill ISF value shows final ISF two times, "ISF: 2.2 > 2.2"
To Reproduce
Steps to reproduce the behavior:
Expected behavior
correct should be in my example "ISF:3.0 > 2.2"
OiAPS crashed.
Build: alpha de9cd83
The sequence of events might have been different, but it apparently happened when selecting Glucose Direct and trying to open the app when it's not installed.
To reproduce:
Select Glucose Direct from GCM value
Tap Open Glucose Direct
--> App crash, force close does not resume operation of the app (black screen)
The crash only happened on first attempt, after a rebuild/launch from Xcode, a warning popped up:
Is your feature request related to a problem? Please describe.
The temp target view allows to activate a experimental slider to "simulate" a target in regard of the % basal insulin (HBT) . Now, the implementation is done with Override profil and not useful to stay here
Describe the solution you'd like
remove this part in the view and all code associated in HomeView and others...
Describe alternatives you've considered
no object
Additional context
Would it be possible to play an alarm sound when the app is killed?
Some users like to clean up the task list and the app accidentally gets killed.
The Libre3 app has such a function. This has proven to be so beneficial.
There is a double Close button in the CGM settings dialogue:
Build: https://github.com/nightscout/Open-iAPS/tree/d529658aed9d14275878f799e238f656fabe881d
--Added 30g of carbs at 5:58 a.m. on May 11 (log attached).
--But 2 entries appeared in the History screen in Trio
I deleted the second errant entry. So sorry, don't have a screenshot for that. Should have captured that first.
--Running Trio v0.1.0
--Branch: dev6f862aa
--Omnipod Dash, G7
This may be an intermittent bug -- and possibly only a display issue. Same issue was reported here in the iAPS Github Issues area and may be related to writing to Health:
A potential fix was suggested here:
Artificial-Pancreas/iAPS#564
Could be user error, but I'm pretty sure I didn't enter this twice.
I still have iAPS 4 on my iPhone 15, not sure if that could be related. I've been seeing how it differs from what Trio advises.
But I've experienced the bug reported above (Issue 450 in iAPS), and it was thought to be Apple Health related, so I turned it off. I've turned it off in Trio now as well.
There is no banner popping up during bolusing on the main dashboard.
Describe the bug
With our current configuration, we have Identifier Names identical to another app,
To Reproduce
Steps to reproduce the behavior:
Examine what is in the Name Column and what is in the Identifier Column for identifiers under Apple Developer account.
Expected behavior
The names should not be subject to confusion
Screenshots
Note that the Name columns for iAPS and Trio is the same, but each have unique Identifier.
Identifiers created by GitHub actions:
Identifier created with Xcode build:
When saving a setting, better feedback should be given to the user whether it was saved or not.
Currently, the way to check an item has been saved is to re-enter to the menu after saving to check the value. Some users may have haptic feedback disabled?
Menu Items to be address (but not limited to):
Describe the bug
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The 4 XCTAssert line that fail are: lines 34, 36, 38 and 42 for FreeAPSTests/CalibrationsTests.swift
Notification is present every loop cycle despite having notifications turned off.
The notification will immediately disappear, within 1 second.
Config notes:
Freestyle Libre 2
DASH
@marionbarker has been creating PRs towards LoopKit for the submodules we use in OiAPS to replace โLoopโ with the actual app name.
Until the PRs are accepted, we will point OiAPS to the commits in the loopandlearn
branches used for the PRs.
@marionbarker, please post links to the relevant branches here so we can easily set this up for testing. Thanks!
Question raised in Discord:
@Sjoerd-Bo3 asked: "is it not possible in Oiaps to add insulin retrospectively? So when I injected insulin manually, and forgot to log. I could in 3.x but was it not in there before?"
@dnzxy listed these relevant PRs from iAPS:
Artificial-Pancreas/iAPS#267
Artificial-Pancreas/iAPS#271
Artificial-Pancreas/iAPS#289
and adjacent: Artificial-Pancreas/iAPS#272
Freestyle Libre SAGE is not uploading to nightscout at all.
Propose to add this to OiAPS, as previously done here by @MikePlante1:
Artificial-Pancreas/iAPS#360
This PR includes a feature for uploading the branch name and git reference as a โchangelogโ to TestFlight, displayed under โWhat to Testโ for each build. However , there is a bug in AppStore Connect / TestFlight, where fastlane fails to upload changelog if it was never entered before.
The workaround is to make a manual โTest Detailsโ entry from AppStoreConnect (ASC), then build again. Then, the branch and git ref will be displayed under "What to Test" in both TestFlight and ASC.
This is a known issue, with various proposed workarounds including this one:
fastlane/fastlane#16129 (comment)
(This was originally included in another PR, but did not belong there ,hence I created this issue report instead)
Asssigned to @MikePlante1, including the required documentation :-)
Is your feature request related to a problem? Please describe.
A safety concern when it is possible to apply a TT or Profile override with bg target below oref (safety) limitation of 4.4 mmol/L.
Describe the solution you'd like
TT & Profile overrides should be limited to 4.4. And in setting > Target glucose > not be able to set below 4.4 Oref will automatically limit set target glucose to 4.4 but not limit TT & Profiles
Describe alternatives you've considered
A warning when to apply a TT or profile when below oref safety limit 4.4
Displaying profiles/overrides in NS is important for the adoption of these features by remote caregivers. This is very relevant with the introduction of refactored shortcuts in #144.
iAPS display this by using Exercise events, as these are displayed in both the main chart and in Day to day reports.
The field to enter a bolus doesn't appear to have a proper two-way sanity check. Whilst it checks for a max bolus, it doesn't check for a minimum bolus nor does it respect the Bolus Increment. This means you can enter impossible values such as 0.0001U. This makes the app crash immediately after running FaceID. Moreover, for the 2nd issue, if your Bolus Increment is set to 0.5: you can still try to bolus 0.025 or, as another example, 1.025 - whilst neither ought to be possible with 0.5 increments. Ideally, minimum bolus is tied to bolus increment.
Medtronic 754, Trio Dev, iOS 17.5 and lower.
@marionbarker reported that the Tidepool integration uploads wrong basal rates.
A fix has been proposed in #118 by @avouspierre, this will be merged into alpha now. Let's track the results of the testing here.
I tried to mix with the button "temp target" on the apple Watch the capability to choose a temp target or a override preset. The result is available here :
Currently the code is available but there is too many duplicate code in this version. I need to refactor the first implementation of profile override in swift (storage, use swiftInject, implement observer,...).
What's your though ?
Looks like all boluses are labeled as "automated". This highlighted bolus was manual.
(This test was done via the alpha branch, not specifically this PR, btw)
Originally posted by @MikePlante1 in #30 (comment)
There is currently no guardrail / max limit for logging of external insulin ("Bolus without actually bolusing"). This can cause issues with dISF, since even after deleting an erroneous entry, the bolus dose will still linger in the TDD storage in CoreData, and there is no way to reset this except by deleting the app.
Suggestion: Introduce max limit for external bolus. Possibly based on the pump setting for max bolus. @
Please note that some might set a low max bolus for the pump to reduce the risk of large doses causing "tunneling". Some also combine this strategy by taking the bulk of the meal bolus by pen/syringe. In this case, limiting external bolus to the max pump bolus will be inconvenient. Possibly 3 - 10 x max pump bolus would be appropriate? Otherwise, we need a separate setting for max external bolus.
This has been discussed at length in the iAPS project, but I can't find the discussion right now.
According to https://docs.diy-trio.org/en/latest/settings/configuration/preferences/othersettings.html#remaining-carbs-cap a value of 90 is the absolute minimum for "Remaining Carbs Cap" in Preferences (all the wayyyy at the bottom :)). However, the app allows you to set a value far lower than that. If the limit is supposed to be 90 at the lowest in accordance with the docs, not accepting lower values in that field may be a good idea.
From Lukas Schuster @schusterlich (primary dev of Cockpit) to connect Trio data directly to Cockpit without going through Apple Health. Doing so will enable Trio users to access the premium membership for free to view their Trio data and data analysis in Cockpit.
what needs to be done is:
Check if the App is Installed:
In the app that is calling your custom URL scheme, you need to first check if your app can handle the URL. This can be done using the canOpenURL: method of UIApplication. This method returns a Boolean indicating whether or not your app can handle the URL scheme.
Code-Snippet:
if UIApplication.shared.canOpenURL(URL(string: "diabetes-cockpit://")!) {
UIApplication.shared.open(URL(string: "diabetes-cockpit://?activate=iaps")!, options: [:], completionHandler: nil)
} else {
// App is not installed, open App Store link
UIApplication.shared.open(URL(string: "[https://apps.apple.com/us/app/diabetes-cockpit/id1580577116")!](https://apps.apple.com/us/app/diabetes-cockpit/id1580577116%22)!), options: [:], completionHandler: nil)
}
Configure URL Schemes:
Make sure that the calling app has your custom URL scheme listed in its Info.plist under LSApplicationQueriesSchemes. This step is necessary for the app to check if your app is installed:
Code-Snippet:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>diabetes-cockpit</string>
</array>
Since earlier days, the calibration of Libre sensors has been persisted across sensor sessions. I believe it would be more appropriate to reset the calibration at sensor change. Is this possible?
I did notice a function that reset the calibration when switching to another type of CGM. Perhaps this could be extended to switching to a new Libre sensor?
I think a new setting should be added for Adjustment Factor so Logarithmic DynamicISF can default to 0.8 and Sigmoid DynamicISF can default to 0.5. This prevents new users from starting DynamicISF in Logarithmic mode with a default of 0.5 which seems to often lead to prolonged highs for many people. Also helpful for those who switch between Logarithmic and Sigmoid depending on their situation.
Create templates for users to submit issues for:
Problem:
The live activity only shows the values when I entered the app.
The data that was backfilled or in between data the openings of the app was in the widget.
Without the simulator/NS it works fine (G7 + Dash instead), but I don't understand why it doesn't display the backfilled data aswell. Because the data is in the app so it should also show in the Live activity right?
Smartphone:
Settings:
Describe the bug
Using Libre, when a high or low notification is sounded, the app appears to be using non calibrated data to trigger the alarm, despite being lower (in this case) than the alarm trigger point.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
High alert only applies to calibrated values.
Screenshots
If applicable, add screenshots to help explain your problem.
Smartphone (please complete the following information): iPhone 15 Pro
Setup Information (please complete the following information):
Additional context
Add any other context about the problem here.
Copied from @dnzxy's comment in Discord (https://discord.com/channels/1020905149037813862/1226878954535649351/1228787378529894411)
the way this currently works is this:
you create a profile or load a profile preset, both are stored in CoreData
that is then read into a Swift object in memory, and stored as another CoreData entity, Oref2_Variables
that is read again, then passed into JSON and passed to the oref algorithm
there all those variables, mostly boolean ones, are read from JSON, re-instantiated in the JS algo code and simply just to do some if else checks or to set a few variables to true/false or set %s
The this should work is all swift based and the only things that need to be passed to oref would be the current basal rate, the current isf rate, the current cr rate and all those modified by the selected %.
If you set the profile to disable SMBs, that can also happen Swift-based
determine basal should ideally only do exactly that: determine required insulin, not have a logic for adjusting setting metrics or basal rates.
Not sure if these should be updated or just deleted...
These lines in FreeAPS.xcodeproj:
844
3146
3188
And maybe these lines too:
601
825
No restarts in between. Dev happily loops on NS CGM with phone locked, alpha only loops with phone unlocked. Restarting now to see if it makes a difference.
Behaviour confirmed after restart. OiAPS open just before I close phone screen. Cycle home with phone/pump/orange in jacket pocket. On arrival home Live Activity is stale and OiAPS alpha loop is red. Manually force a loop and it goes green.
As a user I would like to have the option define my own minimum and maximum scaling for the Live Activity Chart, so I can better view the information that is relevant to me.
Since the move to Libre submodule the ability to calibrate outside of setting a Boolean flag in the code has been removed with this commit
iAPS allowed direct "blood glucose level" insertion and it worked out the calibration slope + intercept for you. Functionality should return to this state.
Live Activity graph is red all the time when the value conversion is set to mmol/L.
Feature request: Add button to open the CGM app or source in the general CGM settings view.
A button that opens the CGM app (or Libre direct) will be convenient here when #24 is merged, as tapping the BG value will no longer opens the app. This button can be the same for all CGMs, and we can use the same mapping of app urls that we used previously when tapping the BG value.
I propose to put this button near the top or middle, without having to scroll down and easily tappable without risk of tapping another button or setting.
Screenshot from the alpha branch (the double Close button is described in #69):
Build: https://github.com/nightscout/Open-iAPS/tree/d529658aed9d14275878f799e238f656fabe881d
This may have been operator error but I was not able to modify settings on iAPS to lower the maxBolus value in the app to connect to a Medtronic pump. I had to modify the pump maxBolus to enable the connection.
Steps:
Max setting exceeded
There's an option to have the app alert you when the battery of your EmaLink goes below a user adjustable threshold. (Eg: I have it set to < 30% = alarm.)
However, the app never seems to query the EmaLink (for that variable) unless you go to Pump and tap your EmaLink to view status and reveal the settings. It will only at that moment ask for the battery level, show it and trigger the notification/alarm - at which point it's a bit late.
It'd be nice if the app queries the EmaLink battery once every x hours. Maybe every 3 hours or so?
Note: had the same issue in the previous iteration of the app, where it was mentioned that it did work fine for OrangeLink.
Medtronic 754 + EmaLink, Trio Dev, iOS 17.5.
We now have an โAdd CGMโ button when no CGM is configured. Perhaps we should have a similar button for to set up a pump when not configured?
Tagging @avouspierre
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.