jwoglom / tconnectsync

Syncs data from Tandem Source (formerly t:connect) to Nightscout for the t:slim X2 and Mobi insulin pumps
MIT License
114 stars 63 forks source link

Hints on usage of iob: Insulin-on-board? #86

Open bjornoleh opened 1 year ago

bjornoleh commented 1 year ago

I did read the manual about the limitations of IOB data added as an “activity”. Still wondering if it’s ok to ask about how people have made use of this. Perhaps someone come up with a hack to get it displayed in NS somehow?

Thanks!

jwoglom commented 1 year ago

@bjornoleh I don't think it's currently possible to get the IOB amount to show in the Nightscout UI, however you can get the value from the API by making a request to NIGHTSCOUT_URL/api/v1/activity.json?find[activityType]=tconnect_iob, which returns, e.g.:


[
  {
    "_id": "62d85a6d25fef6066b28ac6f",
    "activityType": "tconnect_iob",
    "iob": 14.42,
    "created_at": "2022-07-20 15:30:28-04:00",
    "enteredBy": "Pump (tconnectsync)"
  },
  ...
}

It's probably possible to patch Nightscout to show this, but I haven't looked into it heavily.

bjornoleh commented 1 year ago

Thanks!

I also wonder if it would be possible to write IOB data as devicestatus instead? Perhaps as a Loop or OpenAPS devicestatus? Then I imagine it could be displayed in one of those pills, and the data would hopefully also be propagated to the IOB pill. Surely I could be missing something here.