Code Monkey home page Code Monkey logo

Comments (5)

JasonJShuler avatar JasonJShuler commented on June 2, 2024

Does it show correctly in t:connect?

If you power off the pump, t:connect does something similar, assuming it delivered insulin at the basal rate till you power it back on...

from tconnectsync.

vonstein2002 avatar vonstein2002 commented on June 2, 2024

Yes, tconnect shows it correctly. There are no treatments entered in to nightscout for the manual stop or the manual restart but all treatments either side of the stop show up in nightscout.

from tconnectsync.

JasonJShuler avatar JasonJShuler commented on June 2, 2024

from tconnectsync.

jwoglom avatar jwoglom commented on June 2, 2024

Thanks for noticing and reporting this -- this is a perfect example of the sort of edge case that's easy to miss without either a lot of real-world use or very good test cases.

I've been looking into the data that tconnect returns from its API to pinpoint exactly how to detect when this situation occurs. Given the following data:

image

I was able to validate that the "0 u/hr Basal" basal events are properly being processed, as they show up in api.controliq.therapy_timeline with a 0.0 basal. There is also an associated suspensionDeliveryEvent with the same timestamp:

{
  'basal': {
    'algorithmDeliveryEvents': [
      ...
      {'y': 0.0, 'duration': 897, 'x': 1635195156}, # 1:52 PM
      ...
    ]
  },
  'suspensionDeliveryEvents': [
    ...
    {'continuation': None, 'suspendReason': 'control-iq', 'x': 1635195156}, # 1:52 PM
    ...
  ]
}

But, like you mentioned, "Manual/Alarm" basal events are not currently working.
I discovered this is because a suspensionDeliveryEvent exists for it, but there is no associated delivery happening at that time:

{
  'suspensionDeliveryEvents': [
    {'continuation': None, 'suspendReason': 'manual', 'x': 1635188855} # 12:07 PM
  ]
}

I've added some code to catch this case and add a manual basal event for 0u/hr at the time of the manual suspension, with a duration lasting until the next basal event detected by the pump.
The event should appear in the nightscout API (at /api/v1/treatments) with reason "manual suspension".

from tconnectsync.

vonstein2002 avatar vonstein2002 commented on June 2, 2024

Thanks for your work on this project! Allows me to use openaps autotune again :)

from tconnectsync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.