Skip to content

Trio v0.2.0

Compare
Choose a tag to compare
@Sjoerd-Bo3 Sjoerd-Bo3 released this 17 Aug 19:06
6433d94

Trio v0.2.0 trio

expand details

This app splits from Artificial-Pancreas/iAPS at v2.3.3 on the main branch and this commit. Very minimal UI changes were made in this initial update, but while it may look and for the most part seem the same as iAPS v2.3.3, you can see from the number of commits and files/lines of code changed in this PR that there are extensive changes under the hood. These changes were done to ensure it is truly open source, peer-reviewed and tested, to keep it in sync with updates from Loop's submodules (the stuff that connects your pump, CGM, and services), to fix some bugs, and to add a few new features.

The Team

expand details

Trio is a collaborative project set up by members of the DIY community who welcome a peer reviewed, Open Source iOS implementation of the Oref/APS algorithm.

The team consists of:

  • Software architects
  • Developers
  • Code reviewers
  • Designers
  • Testers
  • Documentation specialists
  • Project managers / agile coaches
Anyone who wants to contribute is welcome to join the team!

The Name

expand details

“Trio” is inspired by several joint efforts:

  • Algorithm/CGM/Pump: the three components that make up your DIY loop
  • Basal/CR/ISF: the three main settings that, when tuned, treat your TxD
  • Carbs/Fat/Protein: the three main food components that impact your blood glucose
  • FAX/iAPS/Trio: the three stages of Oref/APS leading to the birth of Trio
  • In true DIY fashion, make the Trio definition individualized to you

Hosted by The Nightscout Foundation

expand details

The most obvious change from iAPS, other than the name, is that the repository location has changed to be housed by The Nightscout Foundation, alongside Nightscout and AndroidAPS. The Nightscout Foundation has a long track record of facilitating innovation in DIY diabetes technology and stoking collaboration between many developers and projects. This will keep Trio in the hands of the community rather than a single individual, and ensure all development is peer-reviewed and tested before being released.

New Bundle ID

expand details

If you're switching to Trio from iAPS, another big change is the app's Bundle ID, which is now org.nightscout.TEAMID.trio. This means Trio will not overwrite the iAPS app on your iPhone, but all settings must be re-entered and all devices re-connected. Trio will need about 24 hours of data before the dynamic features can be enabled.

If you're using Omnipod DASH or Eros, you will have to pair a new pod to start using Trio, but all other devices can transfer mid-session.

New App Group

expand details

Instead of using the Loop's App Group, group.com.TEAMID.loopkit.LoopGroup, Trio uses its own - group.org.nightscout.TEAMID.trio.trio-app-group. This prevents settings from being retained when deleting and reinstalling Trio while Loop or iAPS is also installed. You still need to delete xDrip4iOS to completely reset settings, though.

New Icons

expand details

New icons have been created as a symbol of the name Trio. (by @tmhastings, plus some old ones by @tqb43)
logos

Default Setting Changes

expand details

  • Default CGM: None (instead of Nightscout)
  • Show high/low lines on main chart: On (instead of Off)
  • High value for main chart lines and statistics: 180 (instead of 145)
  • Sensitivity Raises Target: Off (instead of On)
  • Minimum Safety Threshold: 60 (instead of 65, which keeps it more in line with Oref0)
  • Adjustment Factor: 0.8 (instead of 0.5)
(by @MikePlante1 with input from @bjornoleh and many others)

Sigmoid Adjustment Factor

expand details

With Dynamic ISF toggled on, the effects of Adjustment Factor vary drastically between having Sigmoid turned on and off. Because of this, we've split the Adjustment Factor in two and given Sigmoid its own setting. This allows Adjustment Factor to be defaulted to 0.8 with Sigmoid turned off and to 0.5 with Sigmoid turned on. (by @MikePlante1)

sigmoid settings

External Insulin & Glucose

expand details

External insulin entry (to log non-pump insulin, eg. from an insulin pen) has been moved to the History screen rather than the Bolus screen. External insulin entries will display a warning if amount is larger than Max Bolus setting and will not be allowed if over three times the Max Bolus setting. The History screen also now displays if a bolus was an SMB or External, and uses swipe gestures to delete entries. (by @BrianWieder with many cherry picks from @dnzxy)

History (Treatments) History (Glucose)
historyInsulin glucoseHistory
Log External Insulin Log Glucose
maxExternalBolus logGlucose

Distinguish Manual Glucose Readings

expand details

Manually entered glucose readings are now more noticeable in both the history and the main chart. (by @mountrcg)

Chart History
chart history

Edit Profile Overrides & Temp Targets

expand details

Swiping left on a saved profile override or temp target now gives you the option to edit or delete. Selecting to edit will open a new page where you can change the name and/or any of the settings. (by @dsnallfot)

Option to Edit/Delete Editing a Profile Override
edit or delete delete

LoopKit Submodules (pumps/cgms/services)

expand details

The code that's used to connect to pumps, CGMs, and other things was taken from their implementations in Loop. This release changes where that code is housed from within this app to point to the code in @LoopKit or @loopandlearn's repositories. This allows for a better development as it makes it easy to see the differences between the code used in Trio vs the code being used in LoopKit and allows updates in the LoopKit repo to easily be pulled into Trio and vice versa as submodules are improved in Trio and shared to LoopKit. (by @bjornoleh with help from @marionbarker and @bjornoleh)

Updates to submodules versus what was used in iAPS v2.3.3 (by @itsmojo with help from @marionbarker and others):

  • Use `appName` instead of `Loop` or `Trio` so both apps can share the same code but display their own name. This change is still be applied throughout the different submodules.
  • Reduced the battery load on pods by reducing the rate of getStatus calls to the pod to one third of the previous level without affecting all the other commanding needed to control the pod. This reduced battery load on pods
  • Updated to avoid triggering the Critical Pod Fault 049 (0x31) error which caused a pod loss.
  • Added Tidepool submodule to allow direct uploading instead of using Apple Health.
  • Fix display bug for Medtronic to show scheduled basal right properly.
  • Now guards against time change while a bolus is in progress was added to prevent potential fatal crash requiring app deletion and rebuild
  • Indicate a change in time zone of phone in Medtronic Pump Manager

Oref

expand details

This part is rather technical. Oref (the algorithm from OpenAPS that drives Trio) is written in the JavaScript programming language. In order to perform well in an iOS app, the algorithm is implemented in a minimized format. Until the algorithm is rewritten into the Swift programming language, it needs to be like this to ensure performance. The source code used to build the minimized files is now included in this repo as well as a separate repo trio-oref. This work is quite extensive and has been done and peer-reviewed by several contributors: (beautified/reconstructed by @JeremyStorring and updated by @bjornoleh, @mountrcg, @avouspierre, @MikePlante1, @tmhastings)

Schedule SMBs Off in Profile Overrides

expand details

The Schedule when SMBs are Off option in profile overrides has been improved to make it easier to understand and use. Now, if you want to disable SMBs for the entire time the override is active, toggle on Always Disable SMBs, but if you want to specify a timeframe for SMBs to be disabled, you can toggle off Always Disable SMBs toggle on Schedule when SMBs are Off and set the timeframe. Note that setting a timeframe of 22-6 would disable SMBs from 22:00 (10PM) through 5:59 as long as the override is active during that time.

schedule SMBs off

Restart Bug Squashed

expand details

Since the beginning of FAX, there was a bug where restarting a phone could potentially cause a loss of pump or cgm connection. This was especially detrimental for Omnipod users, as there's no way to reconnect it after it's lost. The fix for this from LoopKit has now been added to Trio. (by @dnzxy, @kskandis, @avouspierre)

Apple Health Fix

expand details

The 2.3.3 version of iAPS had a bug with Apple Health that would crash the app any time a loop cycle was run. This part of the code was re-written and fixed (by @AndreasStokholm), then thoroughly tested and peer-reviewed by the team. Unfortunately there are still problems with Apple Health, as it still creates an excessive amount of entries that significantly increases storage size and can cause AH to lag.

Fix Multiple Meal Entry Bug

expand details

Some people have had the app freeze while entering a meal and mistakenly entered the same meal multiple times without realizing it. The Save and continue is now disabled as soon as it’s pressed to prevent that from happening. (by @MikePlante1)

Fix mmol/L Glucose Target Bug

expand details

The bug causing glucose target to not be settable to certain mmol/L values has been fixed. (cherry-picked from @Jon-b-m by @Sjoerd-Bo3)

Tidepool Integration

expand details

Tidepool can now be uploaded to directly from Trio instead of using Apple Health and the Tidepool app on your iPhone. Note that if both are enabled, you will see duplicate entries in Tidepool, and even after turning one off, you could still see up to a week of duplicate data. (by @avouspierre)

Tidepool

Dexcom Share Integration

expand details

Dexcom Share has been fixed so it can now be used as a CGM source. Also, if you use Dexcom G6 as your CGM and you enter your Dexcom Share credentials at the bottom in ⚙️ > CGM > CGM Configuration, missed readings should backfill in Trio from Dexcom Share. Keep in mind, though, when you change G6 transmitters Trio will continue to pull readings from Dexcom Share causing you to rely on internet for readings until you update your G6 Transmitter ID in Trio. (by @avouspierre)

Meal Settings

expand details

There is a new section in settings called Meal Settings. In it, you'll find Max Carbs (which used to be in Pump Settings), Max Fat, Max Protein, and the Fat and Protein Conversion Settings that used to be found in it's own section. (by @bjornoleh)

⚙️ Meal Settings
meal settings1 meal settings2

Max Macros

expand details

  • Two new settings added: Max Fat & Max Protein
    • Both are defaulted to 250g to match Max Carbs' default
  • Label of Carbohydrate limit changed to Limit Per Entry for Meal Settings
  • Shortened grams to g for the meal entry screen
  • If carbs, fat, or protein exceed their limit:
    • Changes g to ⚠️
    • Disables submit button, changes text to red, and replaces with warning
PR.226.mov

Max Bolus

expand details

Manually entering a bolus larger than the Max Bolus setting used to just deliver the max bolus amount, but now this setting prevents the bolus from being delivered until the amount is lower than the max setting. (cherry-picked from @Jon-b-m and modified by @MikePlante1 with input from @bjornoleh)

Also now displays the value read from the pump instead of from settings to ensure the correct value is shown. Important for Medtronic pumps and in the future for Dana pumps. (by @bastiaanv and ported by @dnzxy)

Max Bolus

Live Activities (Dynamic Island & Lockscreen Widget)

expand details

Live Activities have been added to show relevant data without opening Trio. This displays glucose, delta, and trend on the lock screen (iOS 16.2+) as well as in the Dynamic Island (iPhone 14+). Optionally, a glucose graph and current IOB & COB can also be displayed. Consistently updated every 5 minutes with every loop cycle. (cherry-picked from @nas10, @polscm32 and ported by @MikePlante1)

Turn Live Activity on and switch between display options by going to ⚙️ > Notifications

Live Activity Screenshot
Lockscreen (simple) LA lockscreen simple
Lockscreen (detailed) LA lockscreen detailed
Dynamic Island LA dynamic island
Dynamic Island
(long press)
LA Dynamic Island graph

Dexcom ONE+

expand details

Added support for Dexcom ONE+ (taken from this Zulip discussion)

Nightscout Menu Updated

expand details

The menu for Nightscout has been updated to include sub-menus. The new Fetch Treatments toggle controls whether Trio will fetch carbs and temp targets from Nightscout. The duplicate Remote Control toggle has also been removed from Preferences. (by @dsnallfot)

⚙️ > Nightscout Connect
Nightscout Connect
Upload Fetch and Remote Control
Upload Fetch and Remote Control

Import Settings From Nightscout

expand details

Fixed this so it now also works for mg/dL. Also now allows importing from settings saved to Nightscout from Loop and will use the center of your correction range from Loop for the target range in Trio. (by @kskandis and @MikePlante1)

Settings imported:

  • Basal Profile
  • Target Glucose
  • Insulin Sensitivities
  • Carb Ratio
  • DIA

Improve Nightscout Uploads

expand details

Previously, only enacted loop cycles were uploaded to Nightscout, which caused information gaps from loop cycles that were just suggested but not actually enacted for one reason or another. Now suggested loop cycles will also be uploaded as well. (by @bjornoleh and suggested by @scottleibrand)

Fat & Protein Upload to Nightscout

expand details

Fat & Protein are now uploaded to Nightscout when you announce them in Trio. (by @aug0211) image

FPU Conversion

expand details

Oref ignores any carb entry less than 1.0g. This used to happen when Interval In Minutes was set low and/or the amount of fat and protein was small. Now, the carb entries that were converted from fat & protein are saved to ensure they are always at least 1g each and not ignored by oref. (by @dnzxy)

For example, with the default Meal Settings, 10g of protein and 5g of fat used to converted into 7 entries of 0.7g carbs. Now, it will be converted into 5 entries of 1g carbs.

Statistics Range

expand details

The statistics screen now includes the high and low values in the normal range instead of the high and low ranges. This matches the colors of the glucose dots that were already being used on the Statistics screen. (by @MikePlante1)

For this example in a simulator, I kept high/low to the default 70/180 and manually entered these values:

Readings
glucose values
Trio (standing) Trio (laying)
new standing new laying
iAPS 2.3.3 (standing) iAPS 2.3.3 (laying)
old standing old laying

Pump Status Icons

expand details

New icons are displayed when your pod status has a warning or critical message. This will help highlight when a problem occurs with the pump to help make the user aware of the issue. (by @avouspierre)

Pump Warning Pump Critical
Pump Warning Pump Critical

Display icons/buttons when no pump/CGM is selected

expand details

When there is no pump or CGM selected, a button is displayed that will take you to the selection screen for pump or CGM. This does not affect instances where a pump or CGM *is* selected and just not paired. (by @avouspierre)

When Omnipod is removed as a pump source, it will now display Add pump rather than the erroneous No pod warning. (by @kskandis)

no pump cgm

Confirm Bolus Faster on Apple Watch

expand details

An option has been added in ⚙️ > Watch to require less of a turn of the Apple Watch crown to confirm a bolus. (by @MikePlante1, who likes to confirm boluses with his nose)

Screen.Recording.2024-06-18.at.2.05.20.PM.mov

Hide Keyboard and Delete All Buttons added

expand details

There are now buttons on the keyboard to delete all text and to hide the keyboard. (by @polscm32)

Dismiss or Delete

mmol/L <-> mg/dL Rounding Improved

expand details

A bug was fixed where entering certain mmol/L manual entries were saved incorrectly due to rounding, such as 7.1 -> 7.0.

Eventual Glucose Rounding for mmol/L

expand details

Eventual Glucose now rounds to 1 decimal place for mmol/L users instead of 2 on the main screen as well as the watch app.

Screenshot 2024-07-15 at 10 14 06 PM

Tests Enabled

expand details

Added ability to run tests on Trio and submodules. (by @avouspierre)

Browser Build Updates

expand details

Browser Build updated to new Apple/GitHub standards. (by @bjornoleh) TestFlight Expiration is now displayed in Settings. (by @bjorkert) Gemfile updated. (by @mountrcg)

Disabled Saving Autotune to Pump

expand details

Removed the button for this functionality until it can be fixed, since 0 U/hr basal rates were causing issues with this feature. Don't worry, this feature will return.

Removed Stats Upload

expand details

Removed the option to upload Statistics to Nightscout, since it is no longer compatible with the website this feature was added for before. (by @MikePlante1)

List of individual PRs included in this large PR:

expand details

Go Team!🎉

expand details

Thank you to the following developers who have added commits to this PR and the initial version of Trio: @AndreasStokholm, @avouspierre, @bjorkert, @bjornoleh, @BrianWieder, @dnzxy, @dsnallfot, @JeremyStorring, @kskandis, @kylmcw, @lifeguardz, @marionbarker, @MikePlante1, @mountrcg, @polscm32, @Sjoerd-Bo3, @tmhastings

A heartfelt thank you to everyone who has played a crucial role behind the scenes with their valuable contributions in discussions, project management, coaching, documentation, testing, and more:

  • Dana Lewis (@danamlewis) and Scott Leibrand (@scottleibrand) for their unwavering support and guidance regarding our Oref inquiries.
  • Tim Street for his invaluable insights into the implementation of Oref code.
  • Tim Gunn (@Tornado-Tim) for his dedicated efforts in setting up and maintaining the Nightscout hosting of the Trio repository.
  • Auggie Fisher (@aug0211) for generously sharing the Discord server for Trio and providing ongoing support for both current and future developments of Trio's caregiver implementation.
  • Pete Wilkins (@petewilkins) for optimizing the Trio Discord home base throughout development and in anticipation of future discussions.
  • Marion Barker (@marionbarker) for her invaluable contributions, including creating the Build Scripts for Trio, enhancing documentation, and offering expertise in various areas not fully reflected on Github.
  • Mike Plante (@MikePlante1) for getting involved in many different aspects of the release and development.
  • Sjoerd Bozon (@Sjoerd-Bo3) and Bjørn Ole (@bjornoleh) for their tireless efforts in driving collaboration and continuously advancing the project.
  • Kelsey Huss (@kelseyhuss) for stepping up without hesitation to communicate progress to the community.
  • Theresa Hastings (@tmhastings) for pulling all the strings, getting the right people involved and spending much of her days on this project one way or another. Without you this would never have happened!
  • Tom Barrows (@tqb43) for sharing your branding and logo expertise and providing support to users in the Facebook group.
  • Magnus Reintz (@t1dude) for his consistent availability (🦇) and invaluable assistance with Facebook community management, clear language and translation management.
  • Jonas Hummelstrand for his commitment to maintaining open communication on Facebook, even during challenging times.
  • Dan (@dnzxy) for consistently fostering discourse aimed at enhancing and enriching the DIY community and Trio project.
  • To Dan, Marvin, Andreas, Mike, Tom, Magnus, Kelsey, and Theresa, Trio owes you its inception. Your proactive approach and DIY spirit didn't just recognize the critical safety aspect but also reshaped the implementation of Oref on iOS. Your bold actions turned necessity into reality. Thank you for your invaluable contributions.