nightscout / nightguard

iOS and WatchOS Client for the Nightscout CGM System
GNU Affero General Public License v3.0
243 stars 158 forks source link

Sensor age (SAGE) counter refers to sensor change, but not sensor start #144

Open bjornoleh opened 3 years ago

bjornoleh commented 3 years ago

If I understand this correctly, the sensor age (SAGE) counter in Nightguard refers to sensor change events, but not sensor start. But in Nightscout, the SAGE counter is displaying the time since last sensor start or sensor change event, whichever is the most recent. Is there any reason not to have the same behaviour in Nightguard? I would like to suggest a change to make SAGE in Nightguard work as in NS.

Two screenshots for approximately the same time:

SAGE 0 hours IMG_20210104_220806

SAGE (sensor start) 1day 18 hours _20210104_221047

dhermanns commented 3 years ago

I‘m displaying Sensor Change like in Android APS. I don‘t remember it right, but think there was a problem with the start. There was a discussion in a Loop issue where they sorted out why sensor change should be considered.

bjornoleh commented 3 years ago

We are using sensor start, because another app we are using (Loop Follow) happen to handle SAGE the other way around. That counter only respond to sensor start events. I asked the author to include sensor change events as well (because that was what we used before...), but he was of the opinion that using sensor start was the correct way.

From my point of view it would be best if the various apps had the same behaviour as Nightscout.

@dhermanns, I could not find any relevant issue reports in Loopkit/Loop or in Nightscout about SAGE or sensor start. Or did you refer to some AAPS issue?

dhermanns commented 3 years ago

Loop Follow was what I ment. But didn't noticed that they implemented it the other way around. I would think the basic idea was:

So the semantics are slightly different. So min(started, changed) would ignore the sensor change date and basically just display the time since last restart. But if you don't care about the overall time the sensor is running, that would probably what you are wanting.

bjornoleh commented 3 years ago

Ok, then you had read my report already :)

It is this one: https://github.com/jonfawcett/LoopFollow/issues/85

I would like to invite you and @jonfawcett to come to an agreement over this. I don't have a strong opinion about how to deal with this, but would prefer if SAGE was handled the same way across platforms.

A the moment I am aware of three different solutions :)

Nightscout: both sensor start and sensor change Nightguard: sensor change Loop Follow: sensor start

bjornoleh commented 3 years ago

We don't do sensor restarts by the way, since our healthcare is providing sensors free of charge.

dhermanns commented 3 years ago

Then you are in a country with a nice health care system. In germany sensors still have to be requested. And in other countries it's even worse ;-)

bjornoleh commented 3 years ago

Absolutely, we are very fortunate in Norway. We do need a prescription from the doctor/endo at the hospital though, and they are a little tight on giving one due to the costs. Fortunately they are quite liberal with giving sensors to children at least, for adults it's a bit more of a struggle, and many will be offered a Libre instead (if at all), which is not exactly equivalent to G6. It's often a case of coming up with the right arguments about the features that are missing in Libre, and what is available in G6 (alarms, follow functionality etc)

Sorry for off topic, and hope you will get to discuss the issue with Jon. :)

dhermanns commented 3 years ago

No problem- very interesting :-)

jonfawcett commented 3 years ago

Loop Follow was what I ment. But didn't noticed that they implemented it the other way around. I would think the basic idea was:

  • Sensor Change: a new sensor has been placed
  • Sensor Start: the sensor has been started or restarted.

@dhermanns and @bjornoleh This has always been my understanding of how NS was intended to function with them which is why I used Sensor Start.

shake73 commented 2 years ago

I love Nightguard, since it (seems to be) the only way to display my son's NS data on my apple watch as a "complication". I do agree that it is annoying that CAGE receives info from NS, but SAGE does not. Sensors refer to the patch and cannula (I am not aware that these can be reused? So why is there a need for a Change and a Start? Are they not the same thing? A transmitter lasts ~90 days, so this could be a "TAGE" or something like that. But I do not understand the logic for having two diferent variable Sensor Change and Sensor Start (other than the 2 hr warmup period?)

dhermanns commented 2 years ago

Hi! Some are reusing the sensor. So Sensor Start is when you try to restart the sensor without changing. Sensor Change is when you are physically changing the sensor.

shake73 commented 2 years ago

Seems like if you use the NS "Sensor Insert" treatment option, then the SAGE will fill correctly in both NS and NG. Loop Follow will pull only "Sensor Start". @jonfawcett can you allow Loop Follow to pull both/either Insert or Start? Or is the solution to just do double entries in NS (Insert and Start each time)?

jonfawcett commented 2 years ago

@shake73 You can read the earlier details in the thread about why I use Sensor Start. The expiration is based on when it is actually started. Insert should be the time of physically inserting the sensor (if you do pre-soak or restarts). Some people use both of the careportal entries and using either/or could be detrimental to their timing of alerts.

bjornoleh commented 2 years ago

Given the fact that Nightscout itself is resetting SAGE by both sensor start and sensor insert, I can’t really see how changing this could be all that detrimental to anyone. And different apps doing the opposite thing must be the bigger issue.

motinis commented 5 days ago

Is there anyway this can be solved? My vote is for replicating NS behavior for consistency.