-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fix reservoir amount in Nightscout uploader #89
base: develop
Are you sure you want to change the base?
Conversation
Related to #88 Change the reservoir amount to use `rawdata["reservoirRemainingUnits"]` instead of `rawdata["activeInsulin"]["amount"]`. * Modify `custom_components/carelink/nightscout_uploader.py` to update the `reservoir` parameter. * Update the `__getDeviceStatus` method to reflect this change. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/yo-han/Home-Assistant-Carelink/issues/88?shareId=XXXX-XXXX-XXXX-XXXX).
I just wanted to mention that I did that on purpose because otherwise, there is no IOB at all. I considered the amount of active insulin as more important than the remaining units in the reservoir. I mentioned that in the Readme. It is up to you to change it, but you would need to update the Readme too |
Ah, so it would maybe better to create an extra sensor to represent the |
In the HA integration we do have that sensor, but in nightscout I only figured out how to set the values for existing plug-ins like the pump plug-in I used. Unfortunately, there were only limited parameters to set and no dedicated IOB field. Therefore, I reused the remaining amount in the reservoir field |
the issue with using IOB as the remaining insulin is that an alarm state is created within NS showing low insulin.. if profiles are setup within NS then there is an IOB pill which is fairly accurate also as far as im aware IOB can be set via the api Data to send: curl -H "Content-Type: application/json" -X POST -d '{"type": "iob", "value": "1.2", "created_at": "2023-08-24T10:00:00Z"}' "https://yournightscoutsite.herokuapp.com/api/v1/treatments" -u "your_api_secret" |
I will check it again as soon as I have some time |
I checked again, and it appears that your statement is not correct. The IOB value in Nightscout is comming from the treatment portal and is claculated by the information of all treatments. Check the API at YOUR_NS_URL/api-docs/ on your own NS server. You will find the API for treatments, with no option to set an overall IOB value. Treatments are only those notes within the graph which have information about carbs and insulin. If you think you have found a way to set the overall IOB value, try it yourself and report back. I would be happy if it is possible, but it didn't work for me (it just created a note in the graph, without information - just the time). |
fixes #88
Change the reservoir amount to use
rawdata["reservoirRemainingUnits"]
instead ofrawdata["activeInsulin"]["amount"]
.custom_components/carelink/nightscout_uploader.py
to update thereservoir
parameter.__getDeviceStatus
method to reflect this change.For more details, open the Copilot Workspace session.