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

sms bolus from AAPSClient #3507

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from

Conversation

mushroom-dev
Copy link
Contributor

Implement bolus sms feature in AAPS client, if feature is enabled in menu and target phone number is provided it allows to send SMS directly from insulin/calc wizard dialog instead of "record only" feature. It still requires authorization code to be typed manually in the second message. If calc wizard was used, results will be saved in "treatment" tab history.

@mushroom-dev
Copy link
Contributor Author

mushroom-dev commented Oct 31, 2024

Implementes #3501 and #3433

@olorinmaia
Copy link
Contributor

One concern is that AAPSClient doesn't always sync perfectly with AAPS. Both IOB and COB can be wrong due to many different reasons. We should consider adding a warning about this in the confirmation box of the bolus calculator in AAPSClient if enabling this feature since bolusing based on IOB/COB from AAPSClient's bolus calculator will then be more tempting to use when it's more accessible.

I don't think there is a way with SMS commands to verify what IOB and COB AAPS really got. It's rare for my part that AAPSClient and AAPS got different IOB/COB, because if sync settings and NS is setup correctly, it's very unlikely to happen. But when looking at threads for support in FB/Discord/Github regarding wrong sync between AAPS and AAPSClient this is a concern I have.

@MilosKozak In the OpenAPS log you can click to view in AAPSClient you can see the exact COB from AAPS; regardless if COB in NS / AAPSClient is wrong. Would it be possible to add IOB amount to the openAPS-log also? That way there is one place one could verify that COB/IOB in AAPSClient is correctly synced with AAPS without visiting master phone.

@mushroom-dev mushroom-dev marked this pull request as draft November 6, 2024 21:28
@mushroom-dev mushroom-dev marked this pull request as ready for review November 13, 2024 20:25
@mushroom-dev
Copy link
Contributor Author

@olorinmaia @MilosKozak what are next steps?

@olorinmaia
Copy link
Contributor

I'm not able to test this as my test-rig don't have sim-cards. One way is to inform about PR on Discord and see if there is any testers there and get more input regarding this PR generally.

@mushroom-dev
Copy link
Contributor Author

@MilosKozak can your review it? I assume groups of people building dev branches and parents needing features I implemented are disjoint. I asked about feedback on parents channel, didn't get any feedback. I have been testing it myself for some time.

@emilisev
Copy link
Contributor

emilisev commented Dec 7, 2024

I am testing this on top of beta1 and first use went all right. I will continue to test in the next few days.

I think I would have searched the preferences for that in Overview > Buttons, since it is where we make use of them, in AAPSClient.

@emilisev
Copy link
Contributor

emilisev commented Dec 8, 2024

When using the bolus assistant or quickwizard, the carbs are lost !
Screenshot_20241208-124246
Screenshot_20241208-124437

@mushroom-dev
Copy link
Contributor Author

@emilisev thanks for catching that! See my latest update for fixes, I found few other corner cases. I also moved sms related settings under button menu as you suggested.

@olorinmaia I added current IOB to sms request response.

I've tested AAPSClient, haven't testes AAPS with updated SMS response yet, but I don't expect any issues there

@emilisev
Copy link
Contributor

emilisev commented Dec 9, 2024

I can't build it, I get : e: file:AndroidAPS-dev/plugins/main/src/main/kotlin/app/aaps/plugins/main/general/smsCommunicator/SmsCommunicatorPlugin.kt:936:65 Unresolved reference 'plus' for operator '+'.

@mushroom-dev mushroom-dev marked this pull request as draft December 10, 2024 20:33
@mushroom-dev
Copy link
Contributor Author

I've pushed compilation fix. Note I didn't test it functionally yet. You are free to do it or you can wait for me. I will send update

- preferences config update
- TODO: calc wizard doesn't send sms, remove animation
- create calc entry in history if sms was send
- fix this option to work only on aapsclient, only when it's enabledd
- enable phone number verification in settings
- fix issues
- update AAPS response for SMS bolus request to include IOB
@mushroom-dev mushroom-dev marked this pull request as ready for review December 14, 2024 20:32
@mushroom-dev
Copy link
Contributor Author

@emilisev I did some testing, haven't found any issues

@emilisev
Copy link
Contributor

Builds all right and carbs are not lost anymore, but I have encountered another case which seems problematic. If I use the bolus wizard from aapsclient but the bolus fails (previous bolus too close or wrong pin....), the carbs are still entered. I think we should be careful with that, it would be an issue is the parent misses the carbs entry, enters again the bolus wizard and the carbs are entered twice... I think this is quite risky...

@mushroom-dev
Copy link
Contributor Author

Personally I am fine with it. It works the same way with bolus alerts. Even if bolus fail timer is not stopped, if you provide another bolus with alarm then you have 2 countdowns. Or maybe it could be improved too? I don't think there's easy way to record carbs only after insulin was successfully administered.

Maybe I could create some job which awakes every 20s to check if there's new carb entry in treatments tab, but I am not sure if such mechanism fits AAPS workflow. Also in that case some other person could enter carbs on primary phone, such scenario is also technically possible.

Personally as caregiver I am fine with current solution, if bolus fails I can always edit treatments tab, it's still big improvement for me. I will need to find time to fix that countdown issue though :)

@gerison77
Copy link

gerison77 commented Dec 21, 2024

I tested it on 3.3.0-rc1 and it works as expected. I wouldn't miss that feature. It is a big improvement. Especially when you have two kids to remote bolus sometimes. Furthermore it helps to check the calculations afterwards.

I want to express my urgent wish this to become a feature in the standard release!

@mushroom-dev
Copy link
Contributor Author

I will try to postpone carbs entry after receiving confirmation about bolus delivery

@emilisev
Copy link
Contributor

emilisev commented Jan 2, 2025

I've been using the functionality almost on a daily basis for the last 2 weeks and it's growing on me :-) I never used the sms commands before, and just started using it to help test your functionality, but I have to admit it is quite useful!
For the "carb when bolus failed" behavior, I guess you get used to how it works. You should probably get more feedback on the matter, not just my own opinion :-)

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.

4 participants