iPhone shortcuts for OpenAPS

I’m planning to trial AndroidAPS in the coming weeks. It’s exciting and intimidating. And it’s made me take stock of what I’ve loved about the iPhone/OpenAPS combination I’ve been using for the past eight months.

Doing things quickly on the go, without too much thought, is the way I want to run my diabetes, and iOS Shortcuts are perfect for this kind of interaction. Just a swipe and a tap or ‘Hey Siri’ to activate them.

Here are the Shortcuts I’ve been using with the DIY hybrid closed loop ‘artificial pancreas’ system, OpenAPS. (note, colours here are iOS 12 Colour palette in iOS 13 is muted)

iphoneshortcuts

See end of this page for examples of how I’ve set these up.

Hypo4gButton  Hypo8gButton

One of the great things about OpenAPS is that you can configure it to run Autotune automatically every night. Autotune iteratively calculates what it thinks your basals, ISF (insulin sensitivity factor) and C:I (carb to insulin ratio) should be, and uses these values in its predictions and dosing. It works best if it has good data. The last thing I feel like doing when I’m having a hypo is entering hypo recovery carbs into the system. So this Shortcut does it for me. It also temporarily increases my BG target to help me recover from the hypo.

Low Carb 8g Button

If I’m eating a low carb, minimal protein meal like veggie stir fry with tofu (no I’m not vegan!) I still seem to need a boost of insulin. This Shortcut feeds into Nightscout to let the system know to treat me as though I’ve just had 8g carbs.

4.5 for 2hrs

I love this one. If I notice my BGs have been sitting a bit higher than I’d like them, this will usually bring them into line. My usual BG target is 5.5mmol/L (100mg/dl). This shortcut sets it to approximately 4.5mmol/L (80mg/dl) for two hours. It’s great for stressful mornings at work, mornings when I don’t exercise, insulin resistance due to hormones, and at workshops or conferences where there’s a lot of sitting around. It’s also useful when I’m coming down with a virus or cold and can see the insulin resistance starting. OpenAPS catches up with this decreased sensitivity really quickly, but using a lower BG target for a while helps to keep BGs in range early.

Exercise 120 Button

This sets a higher BG target for two hours which stops my BGs going low during exercise. I walk for an hour most mornings and activate this Shortcut as soon as I wake up. It works best for me when I activate it an hour before starting exercise as it prevents or minimises insulin-stacking.

Eating Soon Button

Gets the insulin going before meals (when I remember to use it!) by setting a lower temp BG target (4.4mmol/L, 80mg/dl) for one hour.

Cancel Temp Button

A brilliant, quick way to end one of the temp targets I’ve set up. I use it when I can see my BGs have come down quicker than expected after activating the 4.5 for two hours Shortcut or at the end of exercise if my BGs are at the high end of my target range.

Coffee Button

Tells the Nightscout portal I’ve had 5g carbs.

pumpsitechangeshortcut  sensorrestartbutton  newsensorshortcut

These buttons create entries in Nightscout to make keeping track of sensor and pump site changes super easy.

5gcarbshortcut  10gCarbShortcut.png  15gcarbshortcut

These carb Shortcut buttons, for pre-set amounts, tell Nightscout roughly how many carbs I’m about to eat.

carbsshortcut

Tapping the darker blue Carbs button opens the screen below for custom carb entry. (Thank you to Jarred Yaw for drawing my attention to this and Scott Leibrand for the screenshots on Twitter)

When using these carb shortcuts I usually just leave OpenAPS to sort out the insulin via high temp basals. Most people using OpenAPS use Supermicroboluses (SMBs) for this but I haven’t enabled this feature yet due to having tiny insulin requirements.

customcarbshortcut

I also like having the option to enter meal boluses through the pump’s bolus wizard, and often use this instead of using the Carb shortcuts. Either entering a bolus for the entire meal if it’s fast-acting carbs, or for a fraction of it up front for other meals, leaving the high temp basals of OpenAPS to do the rest. This mimics square wave or dual wave boluses but is even smarter, as it incorporates responsive carb absorption observations and calculations into its algorithm, including unannounced meals (UAM). When using the pump’s bolus wizard for bolusing, both the carbs and insulin bolused are automatically uploaded to the OpenAPS system.

See the OpenAPS documentation for more details on bolusing for carbs. *Using the pump’s bolus wizard is not recommended for people using SMBs.

Set-up

Here are some examples of how I’ve set my Shortcuts up.

Your diabetes will vary so please just use this as an example only. It is not medical advice. I have used a confirmation Alert as the first step for all my Shortcuts as a safety precaution.

For more comprehensive, detailed instructions, see the OpenAPS documentation on shortcuts integration. The Apple Shortcuts User Guide is also useful.

Full URL entry for URL sections is: http://yoursite.herokuapp.com/api/v1/treatments.json (Use your own heroku address)

API secret: enter your hashed API secret

Hypo4gButton

hypo4gFull2.png

 

Cancel Temp Button

cancelshortcutFull.png

 

Exercise 120 Button  4.5 for 2hrs  Eating Soon Button

These Shortcuts all set temporary BG targets. I’ve only shown the Shortcut I use for Exercise below. Change Reason, Duration and BG target fields to suit the Shortcut you are trying to set up.

exerciseshortcutFull.png

 

pumpsitechangeshortcut  sensorrestartbutton  newsensorshortcut

Note: eventType must be correctly filled out for these Shortcuts. For Sensor Restart eventType is “Sensor Start”. For New Sensor eventType is “Sensor Change”.

pump-site-changeFull.png

 

Low Carb 8g Button  Coffee Button  5gcarbshortcut  10gCarbShortcut.png  15gcarbshortcut

These are all simple carb entry Shortcuts. Below is the one I use for 5g carbs.

5gcarbsFull.png

 

carbsshortcut

The Custom Carbs entry to enter a precise number of carbs has a few more steps.

carbsFull.png

If you have any Shortcuts or tips to share I’d love to hear about them! Please feel free to add them in the reply section below.

Adding a ‘Note’

If you want to add something as a note to Nightscout, eg. to note that you’ve had Afrezza, you could try something like this.

AfrezzaShortcut

 

10 thoughts on “iPhone shortcuts for OpenAPS

    1. Thanks Michael! You were the one who inspired me to set up shortcuts properly in the first place and your help with the set up on AndroidAPS has been invaluable.

      Like

  1. Hi! Thanks for writing this article. I’m currently using Shortcuts with OpenAPS. I have most of the shortcuts you mentioned above. Do you know how I would create a shortcut for Afrezza to keep track of my puffs in Nightscout? Not quite sure which shortcut to use as a template for that.

    Like

    1. Such a great question! I just set up a Shortcut now to add it as a Note to Nightscout and that worked. Will add it at the end of my post now. Also really curious, do you just do the Afrezza and not announce carbs or bolus and just leave the rest to the algorithm unannounced meals?

      Like

      1. Hi! When I use Afrezza, I enact a higher temp target, usually 160 mg/dl for 60 minutes and then I log my carbs as a carb correction. I do this as a way to disable SMB so I’m not getting too much FIASP on top of my Afrezza. This combination normally works well with about 30 grams of fast-acting carbs. I don’t use Afrezza that often (when I’m impatient to pre-bolus or if my BG is high and I want to come down faster than SMB would bring me down). Another reason I don’t use Afrezza as a regular meal replacement is because it would interfere with the decisions the algorithm makes and subsequently autotune results.

        Like

    2. Discovered that people are working on integrating Afrezza to Loop via iOS Health app so that it’s taken into account by the algorithm. And it’s possible to note it in AndroidAPS (which is what I’m now using) by checking a ‘do not bolus, record only’ box.

      Liked by 1 person

Leave a comment