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

AMA walkthrough doesn't touch on monitor/carbhistory.json #228

Closed
Pazoles opened this issue Jun 5, 2016 · 15 comments
Closed

AMA walkthrough doesn't touch on monitor/carbhistory.json #228

Pazoles opened this issue Jun 5, 2016 · 15 comments

Comments

@Pazoles
Copy link
Contributor

Pazoles commented Jun 5, 2016

Docs below require carbhistory.json but don't discuss creating that file. Making a note to fix this later.

https://github.com/openaps/docs/blob/wip/ama-docs/docs/docs/walkthrough/phase-6/Configure-Automatic-Sensitivity-Mode-and-Advanced-Meal-Assist.md

@eyim
Copy link
Contributor

eyim commented Jun 8, 2016

Looks like Jason uses this alias to create carbhistory.json from Nightscout. I wonder if there is a way to pull it directly from the pump.

ns-carbs = ! bash -c "curl -m 30 -s "$NIGHTSCOUT_HOST/api/v1/treatments.json?find[created_at][$gte]=date -d \"6 hours ago\" -Iminutes&find[carbs][$exists]=true" > monitor/carbhistory.json; exit 0"

However, when using this in my loop I get the error: --+->>-Could not find glucose data

@scottleibrand
Copy link
Contributor

By default carbs are retrieved from bolus wizard entries in pumphistory.json. You only need to pass carbhistory.json if you don't enter carbs there, but only via NS.

Sounds like you're seeing openaps/oref0#127.

@eyim
Copy link
Contributor

eyim commented Jun 8, 2016

Thanks Scott for the clarification on pumphistory.json.

Also that is the exact error I am seeing. I appreciate the heads up on that.

@MosiGitHub
Copy link
Contributor

Thanks eyim and scottleibrand. I was thinking about the same: to make the loop with AMA independent of an internet connection (except the temp targets functionality). So I will try it with the pumphistory instead of pulling the carbs from NS. 👍

@eyim
Copy link
Contributor

eyim commented Jun 10, 2016

Okay this seems to be working for me if you want to try it:

[report "monitor/meal.json"]
profile = settings/profile.json
use = shell
clock = monitor/clock-zoned.json
reporter = text
json_default = True
pumphistory = monitor/pumphistory-zoned.json
basal = settings/basal_profile.json
carbs =
device = meal
remainder =
glucose = monitor/glucose.json

Basically I made the carbs line be just carbs =

In addition, I changed the order as it wanted carbs = to be after the basal line. I also made this change to the device so my meal.ini now looks like:

[device "meal"]
fields = pumphistory profile clock glucose basal carbs
cmd = oref0
args = meal

This seems to work but will test more.

@MosiGitHub
Copy link
Contributor

Thanks eyim. I will try that tomorrow. 👍

@ddaniels1
Copy link
Contributor

Eyim, got it set up, working well

@MosiGitHub
Copy link
Contributor

@eyim I took a look to my version of OpenAps today and I was wondering why you changed the order of carbs etc. I checked which order oref0-meal.js was asking for and for me it seemed that it still was carbs then glucose and the last was basal. I changed to the AMA branch a month ago. Could it be that my branch is outaged?

@eyim
Copy link
Contributor

eyim commented Jun 12, 2016

@MosiGitHub Could be. I changed it because I kept getting this error:

openaps/oref0@0ec424a

Not sure if the device order of fields needs to be exactly the same as the report or not.

@ddaniels1 Great to hear you got it working! Congrats

@MosiGitHub
Copy link
Contributor

@eyim thanks. Now it makes sense for me ...

@scottleibrand
Copy link
Contributor

Is there any remaining work to do for this issue? Anything we discussed above that needs to be documented?

@eyim
Copy link
Contributor

eyim commented Jun 29, 2016

The double counting of carbs issue is taken care of with a recent release. I haven't tested it myself but have seen several others say it is fixed.

The docs still don't mention how to create monitor/carbhistory.json and it looks like the author of the page has a question for you near the end, it says:

Scott / Dana: Can I throw Autosens at the end of this?

@scottleibrand
Copy link
Contributor

Any volunteers to fix those things?

@eyim
Copy link
Contributor

eyim commented Jul 5, 2016

Okay I fixed the creation of the monitor/carbhistory.json alias and also fixed the meal device and report monitor/meal.json.

I don't know what the comment about autosens means so left it as is.

I already submitted the pull request

@danamlewis
Copy link
Contributor

Closing since I believe this is resolved with the new setup script process for AMA configuration.

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

No branches or pull requests

6 participants