Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

G7 battery warning #3239

Merged
merged 5 commits into from
Jan 10, 2024
Merged

Conversation

Navid200
Copy link
Collaborator

@Navid200 Navid200 commented Dec 14, 2023

This PR makes 2 changes.

1- If you currently customize the battery warning level for G7, after the next read cycle is completed, it will automatically be rest to 280. Someone reported this on facebook. I was able to recreate the problem.
This PR changes that so that you can customize the warning level and it will not be reset.

Fixes: #3205

2- The voltage B is highlighted red for almost everyone on the status page for G7.
This PR changes how the voltageB warning level is extracted.
The delta of 10 may have been valid, between voltage A and voltage B, for G5. But, it has not been valid for G6 and it is not valid for G7.
I am still collecting data. So, this is preliminary:
Screenshot 2023-12-13 224647

Instead of subtracting 10 from the voltage A warning level to come up with the voltage B warning level, I am subtracting 25.
We may actually need to even go to 30. But, for now, this should be OK.

This PR makes no change to G5 or G6.

Tests:
I have tested this with G7 and G6.

@emp-00
Copy link

emp-00 commented Dec 15, 2023

@Navid200: Stupid question - how relevant is this for G7? Doesn't G7 only run MAX 10 days + 12 hours and then it shuts down? How come your G7 battery graph screenshots are going up to 35 days - is that a G6 or a somehow modified G7? Thanks for explaining.

@Navid200
Copy link
Collaborator Author

Navid200 commented Dec 15, 2023

@emp-00
A G7 stops working after 10.5 days not because the battery is dead but because Dexcom stops it from working by design.

You can still establish connectivity with a G7 even after 10.5 days to see what the battery voltages are like.
As long as you can establish connectivity, it means that G7 can still run BLE. But, you have a point; just because G7 can establish connectivity does not guarantee that the battery voltage is high enough for the analog sensor components to still be properly functional.

The only reason I am monitoring these voltages after 10 days is to see at what point the battery really dies.

As far as this PR is concerned, I am showing the delta between Va and Vb. The delta is no where near 10. That's the only thing I would like to demonstrate.

@emp-00
Copy link

emp-00 commented Dec 15, 2023

@Navid200 : That's where I was coming from - G7 stops working (by design) after 10.5 days, so why would anybody in "real diabetic life" keep it running longer? If you don't receive readings any more you start another sensor and pull out the old one. As long as the 10.5 days cannot be extended I don't think much work needs to be put into battery life and warning levels. Just my thought on this.

@Navid200
Copy link
Collaborator Author

Navid200 commented Dec 15, 2023

@emp-00

xDrip shows how healthy the two voltages are on the status page. Please see the following.
Screenshot_20231205-145923

As you can see, voltage B is red. This is not because the device is telling us that something is wrong with voltage B being so low.
It is only because we haven't had enough experience with this relatively new device. Now that we have had some experience, I am adjusting the voltage B warning level.

There are individuals who see this red marker on their status page and wonder if their readings are too noisy or they have connectivity problems because something is wrong with their device as suggested by the red marker.

I am making a suggestion to tweak the warning level. This has nothing to do with 10 days or 9 days or 2 days or 12 days.

@Navid200
Copy link
Collaborator Author

Navid200 commented Dec 15, 2023

@emp-00 You can receive a G7 and put it in storage for 5 years. If you then start using it, it is very likely that it will not run for 10.5 days. And in that case, I expect voltage B to show very low and I expect it to be red then.

So, there is no guarantee that a G7 will run for 10.5 days and there is a value in having valid warning levels in xDrip.

@emp-00
Copy link

emp-00 commented Dec 15, 2023

Understood, all good :-)

@jamorham
Copy link
Collaborator

Hi Navid, so I support the change for the voltageb warning but please use the shortTxId() call which I will make public.

I think its very risky to mess around with the setting of the g6 defaults logic because this was really somewhat of a workaround for people transitioning from g5 to g6 or who otherwise have broken settings. I don't really want to integrate those changes.

I personally don't think we should support custom battery warning levels on g7 as we expect them to be uniform enough that if a new revision needs changes to the defaults we would want to know about that rather than people needing to update the setting themselves.

I think we can look to see if they have already customized the value and leave it alone if so to support people who might move back and forwards between g6 and g7 but in general I don't think we need to provide the same support for battery level management because it shouldn't require customization for g7 and really we just need to inform the user if their g7 battery looks duff vs what is generally seen in the wild.

@Navid200
Copy link
Collaborator Author

@jamorham Understood.

Instead of making short tx id public, shouldn't we create an option for the user to choose G7?
Some time in the future, we may end up with a new device that also has a short tx id. Then, we will have to do a lot of rework if both devices end up making that variable true.

But, if we allow the user to choose G7, when the new device comes out, G7 still will be the only device working and we can only add the new device perhaps with another option in the wizard for the user to choose.

Can I add that option instead of making short txid public?

@Navid200
Copy link
Collaborator Author

Will be tested before tomorrow.

@Navid200
Copy link
Collaborator Author

Tested:
Screenshot_20231223-140734

Later on, when I master data binding, I will remove the option of editing the battery warning level for G7.

@Navid200
Copy link
Collaborator Author

Navid200 commented Jan 2, 2024

I have made the change you asked for and tested.
This is ready for merge.

@@ -197,4 +197,4 @@ public static String getLastTwoCharacters(final String txid) {
if (txid == null) return "NULL";
return txid.length() > 3 ? txid.substring(txid.length() - 2) : "ERR-" + txid;
}
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add new line

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -93,6 +95,9 @@ public boolean voltageAWarning() {
}

public boolean voltageBWarning() {
if (shortTxId()) { // G7 only
return voltageB() < (G5BaseService.LOW_BATTERY_WARNING_LEVEL - 25);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be best if 25 is a constant

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a copy of a code that uses 10, which was not a constant. I just followed that practice.

@jamorham jamorham merged commit 6aec37b into NightscoutFoundation:master Jan 10, 2024
1 check passed
@Navid200
Copy link
Collaborator Author

Thanks

@Navid200 Navid200 deleted the Navid_2023_11_25 branch January 11, 2024 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xDrip ignores battery voltage warning level adjustments for G7
4 participants