HOW TO Set up an iOS sleep timer
Start the clock
Play some audio on your iPhone. Open the Clock app, tap Timer, then choose a duration. Tap When Timer Ends, then Stop Playing. This will halt playback once the timer ends. Now just tap Start to begin the timer.
Choose some audio
Search for Set Volume and select it, then change it to your desired level. Search for Play Music and tap it. Tap Music and select what you want to play. To add a whole playlist, tap the ‘+’ at the top of the playlist page.
Set a bedtime
Right now, the shortcut must be started manually, but you can automate the process. Open the Health app and tap Browse > Sleep and ensure you have a Bedtime and a Wake Up time set up in Your Schedule.
Connect a speaker
That works for audio playing from your iPhone or iPad, but what if you play sleep music or podcasts through a speaker? To sort that out, first connect a speaker to your device through either Bluetooth or AirPlay.
Shuffle or repeat
Tap the rightward–facing arrow next to your chosen music. Here, you can decide if the playlist shuffles or repeats. Make sure you don’t select Ask Each Time on either option or the shortcut will require your input.
New automation
Now open Shortcuts and tap the Automation tab, tap “+”, then tap Create Personal Automation. Tap Sleep > Bedtime Begins > Next. Tap Add Action. Search for Run Shortcut. Tap the action in the Scripting section.
New shortcut
Now open Shortcuts and tap “+”, then give your shortcut a name and change the icon. Tap Add Action and search for Set Playback Destination. Tap the result, tap iPhone, then select your desired output
Adjust the timer
Now search for Start Timer and tap it, then set your desired length. You must have set the Clock app to Stop Playing (see step 1) or you will get an alarm buzz when the countdown ends, which might wake you up!
Final touches
Tap the empty Shortcut box and choose your sleep timer shortcut. If you want to turn off your home’s smart lights, you could add them here. Tap Next and deselect Ask Before Running so it runs automatically.