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.
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 also provide an in depth coverage of new apps with Shortcuts support and lots of Shortcuts news.
Using AutoSleep Dictionaries in the Shortcuts app
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.
Select “Get Dictionary Value”
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.
Run your shortcut. It will ask for permissions one time.
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.
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.
Open the Health app on your iPhone.
Tap the Browse tab, then select Sleep.
Under "Your Schedule," tap Full Schedule & Options.
Under "Additional Details," tap Wind Down Shortcuts and then tap Add a Shortcut.
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.
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:
Open the Shortcuts app
In My Shortcuts, find the AutoSleep shortcut already created and tap the little button with 3 dots (...) in the top right hand corner.
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