Skip to content

Instantly share code, notes, and snippets.

@bewest
Created April 9, 2015 22:21
Show Gist options
  • Save bewest/a690eaf35c69be898711 to your computer and use it in GitHub Desktop.
Save bewest/a690eaf35c69be898711 to your computer and use it in GitHub Desktop.
openaps tools

openaps-tools:

openaps-get [opts] [device] [data-type]

Fetch data from devices.

options

--max - limit number of records

Examples:

These three examples would give results in identical formats.

openaps-get --max 2 dexcom glucose
openaps-get --max 2 medtronic glucose
openaps-get --max 2 nightscout glucose

openaps-suggest [opts] [report]

This can read specified results, and creates a suggestion/report/prediction.

openaps-enact [opts] [device] [report]

This can read a suggest/report and send the results or otherwise "act" on it.

openaps-enact medtronic temp-basal ./my-temp-schedule.json

Other tools support

These utilities make it easier to test, develop, and debug the system itself, might be composed something like this:

# store some results
openaps-get medtronic status --reservoir --history --basals -o pump.json
# pipe the system through
openaps-get --max 10 dexcom glucose | openaps-suggest --pump-combined=pump.json --glucose=- tempbasal | openaps-enact medtronic temp-basal temp-basal -

This would allow swapping out "medtronic" or "dexcom" for "test" devices or simulators, which will help experimenting with the predictions and calculations without requiring "real" devices or test subjects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment