Intro
So this is the third version of my solution to sync sleep alarms in iOS to HA. This time not because Tim Apple has changed iOS
, but because of changes in the HA companion app (version 2026.7+). The change is minimal, but to make the information easily searchable, keep everything neatly together and to make sure questions and answers are about the same version, I’ve created this new updated topic. For those who are interested, you can find the previous versions here.
Note
Keep in mind this is just my solution, for my specific needs, but feel free to edit the shortcut to fit your needs. I’ve build these shortcuts to send my sleep alarm to HA, both in the evening: when my iPhone warns me my bedtime is coming up, and when I wake up in the morning. Based on the different times I (plan to) wake up, all kinds of automations within HA change with it. For those who’d like to play around with the shortcuts, I’d recommend to try the ‘bonus’ shortcut first, as it is the simplest of the two.
In order to be able to use my iOS shortcut, you’ll need to follow the following steps:
Pre-setup
For this to work you need the following:
- iPhone running iOS 17 or higher, with the following apps installed:
– Clock
– Health
– Shortcuts
– Home Assistant companion app 2026.7 or higher - Setup a sleep alarm cycle
– either through the Clock or Health app – Apple instructions
– ‘regular’ alarms won’t work with this Shortcut (though Apple did make it easier to sort and select these alarms within Shortcuts, but you’ll have to write your own Shortcut) - Create a ‘datetime’ helper within HA
– You need to know its entity id (similar to input_datetime.example_name)
– Make sure it is a date and time sensor, not just time or date.
– Not sure how? Read this.
Setup
On to the real stuff…
- On your iPhone, download a copy of the Shortcut HA sync iOS 27 sleep alarm 2026.7.
- Answer the questions in the setup of the Shortcut and run it for the first time.
– You might be asked to give this shortcuts permission to access your sleep alarm and/or to send data to HA: just selectalways. - Done! Well… sort of…
Post-Setup
Apple’s way of automating things with Shortcuts differs from how it works in HA. A shortcut like the one you just downloaded, is basically just the ‘action’ part of an automation (or a script) within HA. If you tap on the Shortcut on your iPhone, it runs, but there aren’t any triggers that run the Shortcut automatically.
I personally use two ’triggers’ to run this Shortcut. Either when I close the Health or Clock app (I probably changed the alarm), or ‘When Wind Down starts’. The ‘Wind down option’ is part of the sleep alarm schedule and I’ve set it to 1 hour before my actual bedtime. But there are more options available as triggers.
- Within the Shortcuts-app, go to
Automations. - Create a new Automation, by pressing the
+ - Pick any option:
a. ChooseSleep→Wind Down Begins+Run Immediatly→Next
b. ChooseApp→ Select Health and Clock in the list + uncheckIs Opened+ selectIs Closed+Run Immediatly→Next
c. anything else you like basically… - Look for the Shortcut you just downloaded in
My Shortcutsand select it.
That’s it. I then use HA to calculate different times and trigger certain automations based on my alarm time. Shortcuts is cool and all (and it could be used to do way more with HA as well), but it’s not very easy to use IMHO. I’d for instance advise anyone who wants to change or edit the datetime value, to do this within HA. That’s way easier than trying to edit the shortcut.
Bonus shortcut - Wake-up datetime
I’ve created a stripped down version of this Shortcut+Automation to just send the current date and time to HA when I wake up (read: when I turn off the alarm). The Shortcut can be downloaded here and the Automation that triggers it, is called When Waking Up.
Just like the first shortcut, you need to create a datetime helper in HA for this to work and point the shortcut to this helper.

