Using Shortcuts

The Shortcuts app lets you create your own shortcuts with multiple steps that you can use with AutoSleep and many other apps and system services. You can use scripting so that the shortcut you create does different things based on your sleep data. This can includes all sorts of things, from playing selected music to setting a reminder to sending you a tailored notification. There's a good introduction to Shortcuts here.

How Do I Get Shortcuts

Shortcuts is a default app that comes pre-installed with recent iOS. However if you still do not have it, you can get it for free from the App Store by clicking here

Learn More about Shortcuts

There are some fantastic resources about shortcuts on the web. We think the best you will find is from Federico Vittici & his team at MacStories.

They have a dedicated Shortcuts page that you can read by clicking on this link.

They also provide an in depth coverage of new apps with Shortcuts support and lots of Shortcuts news.

Highly recommended!

Using AutoSleep Dictionaries in the Shortcuts app

AutoSleep updated shortcuts in Version 6.7 to output a dictionary field instead of using the clipboard.

The Shortcuts app can then read the dictionary and you can use these metrics in your shortcut scripts.

It's actually quite easy! Just follow these steps to setup.

Step 1:

Go into Shortcuts app and add a shortcut.

Step 2:

Press Add Action and enter AutoSleep into the search bar.

Step 3:

In this case we will select "Time Asleep" from the list

Press the little i button and you will see it has a result field.

Select Add to Shortcut.

You will now see Time Asleep shown.

Step 4:

You can press the little blue disclosure arrow to determine if you want to show the user interface for this or just use it in the background.

Swipe up to open the search again and type "get value" in the search bar.

Select โ€œGet Dictionary Valueโ€

It will display a prompt where you can enter the dictionary key that you want to use.

Step 5:
Now we need to add the key. An easy way to see available keys is to open AutoSleep, select the Time Asleep tile. If you scroll to the bottom you will see all of the keys in the dictionary for that tile. In the image below you can see all the keys available for Time Asleep:

We will use Sleep as the key.

Then you can use this value as required.

In this case, swipe up, search on notification and add Show Notification.

Run your shortcut. It will ask for permissions one time.

You will then see the following.

Available Keys

To see available keys just open AutoSleep, select the tile from the Today tab, scroll to the bottom and you will see all of the keys in the dictionary.

Time Asleep Shortcut

The Time Asleep shortcut includes the following:

  • "Recharge%": This is the percentage of your sleep goal that you met last night.

  • "Credit %": This is your sleep credit percentage according to your 7 day sleep bank.

  • "Debt %": Your sleep debt percentage according to your 7 day sleep bank.

  • "Sleep": The number of hours sleep that you had. This is in hours. So 7.75 = 7 hours and 45 minutes.

  • "Balance": The balance in hours of your 7 day sleep bank weighted average. This is also in hours. So 8.25 is 8 hours and 15 minutes.

  • "Start": The start time of your main sleep session.

  • "Until": The end time of your main sleep session.

Latest Bedtime Shortcut

The Latest Bedtime shortcut includes the following:

  • "LatestBedtime": This is the latest time you can go to bed and maintain a sleep bank credit. It is a formatted time string value. e.g. "10:30 pm". This format can be used to create reminders.

  • "Waketime": This is the estimated time that you most commonly wake up on the given day. This is also a formatted time string.

  • "TimeUntilBed": This is the number of hours until the latest bedtime. So 8.5 = 8 hours and 30 minutes.

  • "RequiredHours": This is the forecast number of hours sleep that you require in order to be in sleep bank credit. So 8.25 = 8 hours and 15 minutes.

Sleep Rings Shortcut

The Sleep Rings shortcut is based on the 4 AutoSleep rings and includes the following:

  • "Sleep%": The percentage that you have filled your sleep rings.

  • "Quality%": The percentage that you have filled your quality ring.

  • "Deep%": The percentage that you have filled your deep sleep ring.

  • "bpm%": The percentage that you have filled your bpm ring. 75% or higher indicates that your heart rate achieved a good quality nocturnal dip in sleeping heart rate versus your daytime non active, non sleeping average.

  • "Sleep": The number of hours sleep. This is in hours. So 7.75 = 7 hours and 45 minutes.

  • "Quality": The number of hours of quality sleep.

  • "Deep": The number of hours of deep sleep.

  • "bpm": Your average sleeping heart rate.

  • "SleepRating": The AutoSleep Sleep Rating that is displayed in the sleep ring section.

Readiness Shortcut

The Readiness shortcut is based on the daily readiness star rating, which considers waking HRV and waking pulse:

  • "Stars": The readiness star rating as a number to one decimal place.

  • "HRV": Your waking HRV reading in ms.

  • "bpm": Your waking pulse in bpm.

  • "BaselineHRV": Your 28 day average waking HRV in ms.

  • "BaselineWakingBPM": Your 28 day average waking pulse in bpm.

Shortcuts with the Apple Sleep app

You can use AutoSleep with the Apple Sleep app, we have an entire page answering all the common questions on this here, so be sure to review this first. If using both AutoSleep and Apple Sleep, shortcuts can help with making AutoSleep available on the lock screen or showing your sleep stats at wake time.

Add AutoSleep to Lock Screen at Wind Down

When you set a sleep schedule in the Health app, you can run shortcuts from the Lock Screen of your device as you prepare for bed, which is handy if the Wind Down mode has been enabled. For example, we can setup AutoSleep as a shortcut to easily open the app when it's time for lights out.

  1. Open the Health app on your โ€ŒiPhoneโ€Œ.

  2. Tap the Browse tab, then select Sleep.

  3. Under "Your Schedule," tap Full Schedule & Options.

  4. Under "Additional Details," tap Wind Down Shortcuts and then tap Add a Shortcut.

  5. Scroll to the bottom and tap on 'Select an App From Your Library". Select AutoSleep from the list, then Open AutoSleep. You should see the image below once setup correctly.

  6. When Sleep Mode is next active, you'll see a Shortcuts button in the centre of your Lock screen. Tapping this will allow AutoSleep to easily be open.

Add Existing AutoSleep Shortcuts to Lock Screen in Sleep Mode

When your device is in a scheduled sleep mode using the Apple Sleep app, you can setup any AutoSleep shortcuts to show on the lock screen. See below some existing AutoSleep shortcuts already setup. So when the Apple sleep mode locks my iPhone, I can still use 'Lights Off' to trigger AutoSleep from the locked screen, or when I wake up I can easily access 'Sleep Rings' to see how I slept.

Heres how to add them to show while in sleep mode:

  1. Open the Shortcuts app

  2. In My Shortcuts, find the AutoSleep shortcut already created and tap the little button with 3 dots (...) in the top right hand corner.

  3. Tap a similar button blue button with 3 dots (...) also in the top right hand corner.

4. You will now see the option to enable 'Show in Sleep Mode' (see below the example for latest bedtime shortcut). Apply to this any of your AutoSleep shortcuts

Next Topic - Clock
Go to User Guide