Blog Post: Using ANY iOS 18 + iOS 26 Focus Mode to trigger HA automations

If you are an Apple user and would love to trigger Home Assistant automations based on focus mode changes, this post is for you. While in iOS 18 Apple made this fairly easy for most focus modes, “Sleep” was special for some reason. It was missing the focus mode “on” and “off” triggers that every other focus mode had.

For iOS 18, I have a fresh blog post that uses a simple third party utility to FULLY automate ANY focus mode change on your iPhone. I now have fully automated bedtime scenes that turn on when sleep focus mode is enabled, and a morning scene that is triggered when sleep focus mode is turned off.

In iOS 26 developer beta 1, Apple has removed the sleep focus mode limitations and now all focus modes have the same “on” and “off” triggers. This means no third party tool is needed on iOS 26 to trigger HA automations for ALL focus modes.

Check out my full how-to guide here for iOS 18 and iOS 26:

1 Like

Hi! Very well written tutorial, easy to follow. But I ran into one problem, the “When” in the shortcuts app doesn’t have the “Is Turned On” or “Is Turned Off”, the options I have are “Wind Down Begins”, “Bedtime Begins” and “Waking Up”. I chose “Bedtime Begins” for turning on Sleep Focus Mode, which works well, but for turning off Sleep Focus Mode neither of the other two options work.

I’m on an iPhone 14 Pro running iOS 18.5.

I solved this issue by an automation that triggers when the state of ‘binary_sensor.(your iPhone name)_focus’ changes to turned off. This sensor is an entity from the Mobile App integration. This seems to work well, but something that maybe could be a problem for someone is that it triggers the automation the even if you turn off one of your other focus modes on your phone, but to be honest I can’t see how that could cause a problem.

Same here. Doesn’t have those options on IOS 26, IPhone 15 Pro.

Same here. I don’t have this option on iOS 36, but I do have it on iPad.

I also don’t have a Turn off or on. Maybe something changed between the beta and release.

Did the “Waking Up” work if you let the scheduled time for wake up pass, and just not for manually turning off Sleep Focus? Or for neither?

Update: Just did a quick test and set my wake up time and it did actually run the automation and toggle off the input_boolean in HASS after the wake up time and clearing the alarm.

So the wakeup just doesn’t seem to work only when manually toggling off Sleep Focus.

Anyone, found a way to do it the opposite way - set the “Focus” mode based on actions in Home Assistant ?