NightscoutFoundation / xDrip

Nightscout version of xDrip+
https://jamorham.github.io/#xdrip-plus
GNU General Public License v3.0
1.4k stars 1.15k forks source link

Testers needed for NovoPen NFC syncing #2074

Open jamorham opened 2 years ago

jamorham commented 2 years ago

I have a working open implementation for syncing dose information from the NovoPen 6 and NovoPen Echo Plus which I've been testing internally.

I am planning to make this available shortly in a nightly. This issue ticket is to find people willing to test the feature, receive feedback and diagnose any problems or incompatibilities.

So far, the way it works is that the preference feature must be enabled from within the Insulin Pens preference screen and then the pen display is touched against the NFC receiver of the phone while the xDrip+ home screen is open.

At this point it will attempt to retrieve the last 7 days worth of dose information from the pen and then present these as xDrip treatment items within the display/history log. Duplicate data will be discarded.

Each treatment item contains a note entry giving the pen serial number which it was retrieved from. I would say that this is best suited for logging rapid-acting doses. For long-acting you can use the multiple insulins feature of xDrip and designate each pen to the type of insulin it contains.

In a similar way that the glucose meter feature works, optional noises are generated to indicate data being successfully synced.

To delete all synced pen treatments there is a voice command for testing: delete all pen data

Coexisting with Libre should now be working.

If you prime your pen with a small dose before the real dose then you can specify the maximum size of a priming dose and the time window maximum between the priming and real dose and then priming doses can automatically be removed from the data.

For each dose you can tap on the item on the graph and select options such as adding a note, zeroing the value (if it was not actually a real dose) or with multiple insulins changing the future designation for that pen. (If you change what is in which pen etc)

If you are interested in testing this, please add a comment below with your phone model and android version and pen type. Also please make sure you have switched to the Nightly update channel so that you can receive the update when it is available.

@madsviggers @retroneo @PieterDeBruijn @utzaki @yoshimo @jtxgit @PaarnTh

aleks372 commented 2 years ago

Interested, Galaxy S21 Ultra (SM-G998B) latest Android 12 and Novopen Echo Plus

utzaki commented 2 years ago

WOW! Good to hear! Sure I will do everything to help to test.

Echo Plus, Galaxy S7. The Android version is not known for now and I cannot check because of travelling. Unfortunately, the S7 is my old mobile, which is not in regular use anymore. But for a test, I could install xDrip+ there. My actual mobile is not compatible with Novopen 6. I will jump into testing in week 17 after I will be back.

PaarnTh commented 2 years ago

I'l help. Samsung S21FE (SM-G990B/DS) Latest android (Android 12) Novopen ehco plus. 2 of them.

madsviggers commented 2 years ago

Samsung galaxy s20 Fe, novopen 6, android 12

jamorham commented 2 years ago

The April 11th nightly including this feature is out. Make sure you are on the Nightly update channel and you can manually select Check for updated version from the 3 dot menu on the top right of the home screen to prompt for an update download.

Once installed find in the main settings page at the bottom a section for Insulin Pens and select the NovoPen section and enable OpenNov support. Then when back on the home screen of xDrip you can touch the pen to your NFC sensor (typically on the back of the phone) - Make sure NFC is enabled in your system settings first.

Beware that by default this is designed to sync the last week's worth of dose data. You should hear beep noises to indicate success or failure and whether there is new data available. The pens I've been testing with are new and so don't have many doses logged on them, so I'm interested to know if this works correctly for pens with many more doses logged in them.

To erase the synced data from xDrip see the voice command described in the first comment.

jamorham commented 2 years ago

If you're using Libre and would normally do NFC scans within xDrip, beware that this probably wont work correctly at the moment and enabling the OpenNov feature will probably stop those scans working. To revert to normal NFC behavior, turn off the setting in the preferences for OpenNov and then swipe off xDrip and then re-open it. If that doesn't restore Libre NFC then reboot your phone. I will address this issue after dealing with any issues to do with the actual operation of the OpenNov feature.

loop2016 commented 2 years ago

Thank you, jamorham! Pixel 6, Android 12, Novopen 6 (basal) & Echo Plus (bolus)

jamorham commented 2 years ago

Has anyone managed to test this yet? Keen to know whether its working for you guys? thanks

PaarnTh commented 2 years ago

Yep i have tested. Works perfect. No issues here. First sync was 7days yes.

madsviggers commented 2 years ago

It works!!!!!!!! Just as it should!

aleks372 commented 2 years ago

Works perfectly! Takes less than a second or two to scan and display predictions. Had few Reading failed, but that was because the pen was not in a fixed position.

tolot27 commented 2 years ago

It works in general but create records with Humalog insulin. There should be an option to configure the insulin for each pen ID.

Also, there should be the "priming units" option like for InPen.

tolot27 commented 2 years ago

Deleting an insulin entry loaded from the pen causes a NightscoutUploader exception:

Couldn't find a reference_id for uuid: AAFTP6:Open######:1.0 got: null
Got exception parsing treatment lookup response: org.json.JSONException: Index 0 out of range [0..0)
jamorham commented 2 years ago

@tolot27 Can you describe your use case, which insulins in which pens etc? How you would imagine it could work better and whether the in-pen style priming doses strategy would work as you'd like here. With the nightscout uploads does it just noisily pass through all the deleted records or does it jam the upload process?

tolot27 commented 2 years ago

@tolot27 Can you describe your use case, which insulins in which pens etc?

We have up to four pens for FIASP, Humalog, Actrapid and Tresiba. The FIASP pen is the most frequently used pen followed by Tresiba (once a day).

How you would imagine it could work better and whether the in-pen style priming doses strategy would work as you'd like here.

The first thing we always do before we inject the pen in the body is to fill the canula with 0.5 IE. This is recommend to check whether the canula works correctly (not blocked) and no oxygen will be injected. If I understand it correctly, this is called priming unit. It should not be recorded as active treatment because it is not injected into the body.

With the nightscout uploads does it just noisily pass through all the deleted records or does it jam the upload process?

I can debug it further. Currently, both uploading new records and deleting recently added records causing an exception. Verbose logging does not give much detail.

The exception on upload of a new treatment is: Exception uplaoding REST API treatments: length=23; index=24.

No pen treatment is shown on Nightscout.

jamorham commented 2 years ago

@tolot27 so I assume that you are already using the multiple insulins feature of xDrip and that you'd like pens to match against those? Also you are using the Echo Plus?

In a similar way to inpen I can make it so that it nullifies the insulin value of doses that are <= X units within X minutes of another dose. So for example <=1 unit within 2 minutes of another dose. Do you think this would successfully filter your priming doses?

For nightscout this needs more investigation. I am keen to understand whether it just tries to upload deleted records and then skips them or whether it fundamentally is breaking the nightscout uploading affecting subsequent data?

yoshimo commented 2 years ago

In a similar way to inpen I can make it so that it nullifies the insulin value of doses that are <= X units within X minutes of another dose. So for example <=1 unit within 2 minutes of another dose. Do you think this would successfully filter your priming doses?

What if your current phiol gets empty and you need to refill it? so you have 1 unit prime, first part of the dose, then "recharge" the empty pen, prime another and finish with one more unit? Wouldn't a manual "selection" be better in such a case?

tolot27 commented 2 years ago

@tolot27 so I assume that you are already using the multiple insulins feature of xDrip and that you'd like pens to match against those? Also you are using the Echo Plus?

Yes, I'm using the multiple insulins feature and Echo Plus/Echo 6 pens and like to see insulin/pen assignments.

In a similar way to inpen I can make it so that it nullifies the insulin value of doses that are <= X units within X minutes of another dose. So for example <=1 unit within 2 minutes of another dose. Do you think this would successfully filter your priming doses?

Yes that would be fully sufficient. For penfill replacements, one can delete the not injected doses. But the problem with all deletions is that they will reappear after the next NFC scan. Hence, we need something like an "ignore this treatment" feature.

For nightscout this needs more investigation. I am keen to understand whether it just tries to upload deleted records and then skips them or whether it fundamentally is breaking the nightscout uploading affecting subsequent data?

Only NFC pen readings are affected. They will not be uploaded. All subsequent data manually entered are uploaded to NS.

yoshimo commented 2 years ago

Seems like there is a table needed with pen-id,timestamp and amount to ignore , so it can be filtered out of calculations and displaying.

loop2016 commented 2 years ago

jamorham:

@tolot27 so I assume that you are already using the multiple insulins feature of xDrip and that you'd like pens to match against those? Also you are using the Echo Plus?

In a similar way to inpen I can make it so that it nullifies the insulin value of doses that are <= X units within X minutes of another dose. So for example <=1 unit within 2 minutes of another dose. Do you think this would successfully filter your priming doses?

For nightscout this needs more investigation. I am keen to understand whether it just tries to upload deleted records and then skips them or whether it fundamentally is breaking the nightscout uploading affecting subsequent data?

That's a good idea. But perhaps just importing the last value would be more straightforward and comprehensible for the user. Everything else works great for me. Thanks again. (Pixel 6, Android 12, Echo Plus)

tolot27 commented 2 years ago

That's a good idea. But perhaps just importing the last value would be more straightforward and comprehensible for the user.

But this is not enough for me, because I want to import all the values that my son injected during the day at school.

jamorham commented 2 years ago

There should be a new nightly available on Thursday which will include the following changes:

yoshimo commented 2 years ago

ability to tap on a dose entry and zero it if it was not an actual utilized dose Does this persist across multiple imports from the pen so the ignore state won't get overwritten the next time people import data by connecting the pen?

jamorham commented 2 years ago

@yoshimo yes it does and it will also zero the value on nightscout as well

This nightly is now available.

jamorham commented 2 years ago

Friday nightly will include support for multiple insulin types where a type can be allocated to each pen.

jamorham commented 2 years ago

@aleks372 Do you do priming doses where you would dial up and press the plunger but not inject? Could that be the source of these? (for context a bug was reported which turned out not to be a bug and OP removed the report and screenshot above)

aleks372 commented 2 years ago

@aleks372 Do you do priming doses where you would dial up and press the plunger but not inject? Could that be the source of these?

Yes, it was my mistake, even i read the tread before, i totally forgot that i prime with such doses. Updated to the latest 14/04 and removed them manually.

jamorham commented 2 years ago

@aleks372 If you always prime with <= a certain number of units (for example 2) then you can set it to automatically remove those priming doses via the settings. It will consider a single dose a priming dose if it is less than or equal the number of units specified and within the time window of another dose. Priming doses appear as a small grey syringe on the graph but you can also opt to not have them display at all.

Also for anyone who doesn't know you can tap on any dose and then on the pop-up at the bottom tap on DOSE and you can zero value or add note (and with multiple insulins you can change the designation of which insulin is in that pen for subsequent doses)

The Friday nightly is out which includes the support for multiple insulins. The first time you scan a pen it will ask you to choose from up to 3 of the enabled insulin profiles. Then all following doses will be designated as that insulin type from that pen. If you change which insulin is in which pen then you can tap on a synced dose and select dose -> choose type to change it.

I've also improved the overall reliability and fixed a bug that could affect the initial sync if it failed half way through.

Does anyone have any feedback about the sounds - do you find them useful? Do you have them enabled/disabled etc?

loop2016 commented 2 years ago

I love the sounds. They sound like a funny little cat :)

ERolli commented 2 years ago

Galaxy A51, Android 11, Echo Plus

jamorham commented 2 years ago

@tolot27 does the support now with multiple insulins meet the use cases you talked about before for different pens and insulins etc?

PaarnTh commented 2 years ago

Hello i have problem with tidepool. i have sync my insulin doseage with novopen 2 of them and they are set one bolus and second basal. Today i cheked tidepool and my insulin dosage wasn`t there only some some days none. is it becouse novopen entry or its tidepool error?

Screenshot_20220420-225519_xDrip+

image

tolot27 commented 2 years ago

@tolot27 does the support now with multiple insulins meet the use cases you talked about before for different pens and insulins etc?

Yes, thanks it works like a charm!

Interestingly, I get the error message "Failed to read pen" much more frequent than before. Also, as long as no pen-insulin assignment was done, the assignment dialog pops up many times (likely for each dose read). It should only appear once.

CLKRUN commented 2 years ago

tested also. Works perfect. No issues here. Pixel 6 / Android 12 SQ1D.220205.004 / Echo Plus

jamorham commented 2 years ago

@PaarnTh I'm not sure if the tidepool implementation understands about different insulin types or whether you are getting some other type of bug. This needs checking.

smabrekke commented 2 years ago

Interested! Pixel 4a / Android 12 / Buildnr. SP2A.220405.003 / NovoPen 6 Testing as of now. First impression works fine. Will report if problems occur. Thx!

DavidB766 commented 2 years ago

Hi OnePlus 7/Android11/NovoPen 6. I'm interested but nothing happens when I try to read the pen from xdrip. Diasend reads them OK. I have downloaded and installed latest apk from your webpage.

PaarnTh commented 2 years ago

Hi OnePlus 7/Android11/NovoPen 6. I'm interested but nothing happens when I try to read the pen from xdrip. Diasend reads them OK. I have downloaded and installed latest apk from your webpage.

Have u eneabled insulin pens -> novopen insulin pen -> opennov support enable?

DavidB766 commented 2 years ago

Hi OnePlus 7/Android11/NovoPen 6. I'm interested but nothing happens when I try to read the pen from xdrip. Diasend reads them OK. I have downloaded and installed latest apk from your webpage.

Have u eneabled insulin pens -> novopen insulin pen -> opennov support enable?

I don't have the novopen option! I can only seeInPen and Pendiq

DavidB766 commented 2 years ago

OK, apparently what I had downloaded was for 31 Jan. Downloaded nightly for 26 April and it is now working OK. Now I am trying to work out how to remove the duplicate enteries I had put in manually!

loop2016 commented 2 years ago

I don't have the novopen option! I can only seeInPen and Pendiq

Seems like you are not using the latest nightly build.

Use this link or the "nightly" update channel in the xDrip+ settings. https://github.com/NightscoutFoundation/xDrip/releases

DavidB766 commented 2 years ago

On first use of both my insulin pens I was not asked to select any insulin profile for either. The pen ID is recorded so you can see which insulin is given. It would be nice to easily see/edit a list of insulin treatments. Tapping on them to edit is sometimes quite difficult.

jamorham commented 2 years ago

@DavidB766 to assign different insulins to each pen you must already be using the xDrip multiple insulin types feature - This needs to be enabled and configured in the predictive simulation settings menu. Then when you scan a pen it will ask you which type of insulin that pen is loaded with.

DavidB766 commented 2 years ago

@DavidB766 to assign different insulins to each pen you must already be using the xDrip multiple insulin types feature - This needs to be enabled and configured in the predictive simulation settings menu. Then when you scan a pen it will ask you which type of insulin that pen is loaded with.

Hi, thanks for that. I have now done this, it is a pity you haven't included Tresiba in amongst the long acting insulins. I have found it quite frustrating that once I had deleleted duplicate items, the next time I scanned the pen, it put them all back in there again. Given that I have gotten used to putting bolus amounts in before I inject, it is making me less inclinded to want to scan the pen because I don't want to be forever deleting the duplicates. Would it be possible to scan and then not rescan duplicates even if they have been deleted?

jamorham commented 2 years ago

@DavidB766 Are you able to describe the action profile of Tresiba along the same lines as the others are described in: https://github.com/NightscoutFoundation/xDrip/blob/master/app/src/main/res/raw/insulin_profiles.txt because it can be added to the list.

If you select to zero a dose from the pen by tapping on it and choosing the option then when scanned again that dose should not re-appear.

Can you also explain in more detail your use case, the steps you take when using the system and what happens that isn't right for you?

jamorham commented 2 years ago

See also related: https://github.com/NightscoutFoundation/xDrip/pull/1388

DavidB766 commented 2 years ago

Hi Sorry, a lot of things are happening at the moment. I will get back to you when I can. Thanks David On Friday, 29 April 2022, 16:54:50 BST, JamOrHam @.***> wrote:

See also related: #1388

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

DavidB766 commented 2 years ago

High from what I can see, https://www.novonordisk.ca/content/dam/nncorp/ca/en/products/tresiba-product-monograph.pdf,  onset = 60peak = 60 - 1680 (in reality onset is 30 to 90 minutes, with no real peak as it lasts for about 42 hours, but does appear to tail off a little after 28, hence the figures).duration = 2520

Regards David

On Friday, 29 April 2022, 16:41:14 BST, JamOrHam ***@***.***> wrote:  

@DavidB766 Are you able to describe the action profile of Tresiba along the same lines as the others are described in: https://github.com/NightscoutFoundation/xDrip/blob/master/app/src/main/res/raw/insulin_profiles.txt because it can be added to the list.

If you select to zero a dose from the pen by tapping on it and choosing the option then when scanned again that dose should not re-appear.

Can you also explain in more detail your use case, the steps you take when using the system and what happens that isn't right for you?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

dsnomr commented 2 years ago

Samsung Galaxy note 8, Android 9 funktioniert mit Novopen echo plus

pannal commented 2 years ago

Works well on Poco F2 Pro, Android 11.

I'm using two NovoPen Echo Plus, one for Tresiba and one for Fiasp. It would be nice to be able to "tag" each pen to have a visual color difference in the home graph. Sadly I can't select Tresiba right now, as the PR isn't merged yet.

Thanks for this awesome app.