If you are a Home Assistant user and would like to trigger Home Assistant automations based on iOS or iPadOS focus mode changes, this post is for you. I’ve completely revamped the content for iOS 27 and iPadOS 27, the latest version of the Home Assistant companion app, and the new HA automation engine.Â
Using sleep mode automation triggers in iOS 27 beta is tricky, so I’ll cover my workaround. Hopefully Apple will fix this before the September 2026 release. Sleep focus mode automation triggers are supported on iPadOS 27 and even on macOS Tahoe. As a workaround, you can create the sleep focus mode automation trigger on iPadOS 27 or Tahoe then enable the automation on your iPhone (while disabling it on the other platforms). I’ve submitted a bug report to Apple, via FB23691328 to bring parity to iOS 27.Â
While this post is focused on iOS 27, the concepts are the same for iOS 26. Apple has changed the Shortcuts app UI a bit, so the steps may be slightly different. For anything other than the Sleep focus mode, this post should still work.
Automation Architecture
There are several ways to attack the goal of triggering Home Assistant automations based on iOS focus mode changes. In my opinion, the best way is to use Apple Shortcut automation triggers to change a Home Assistant boolean helper state. Then within Home Assistant you can use this boolean helper to trigger automations, scenes, etc. This keeps the configuration complexity limited to Home Assistant.Â
Yes, the Home Assistant companion app can be used to run automations and do a lot of other things directly in Home Assistant from your iPhone. However, IMHO, this can lead to confusion and could lead to a more fragile setup. If the automation suddenly stops working it makes troubleshooting easier if all the complexity is in Home Assistant. All your iPhone does it change the state of a boolean helper.Â
This post will focus on how I use the Home Assistant automations with the Sleep focus mode:Â
- Bedtime: I just swipe to control center and turn on the Sleep focus mode. A Shortcut personal automation trigger recognizes the Sleep focus mode is turned on and makes a call to Home Assistant to turn on a boolean helper.Â
- Morning: I have a Shortcut personal automation trigger based on the Sleep focus mode turning off that changes the state of my Home Assistant boolean helper. A wake up alarm turns off the Sleep focus mode automatically, so this works for days when I have a wake up alarm. For days without an alarm I just swipe to control center and turn off the Sleep focus mode when I wake up.
As you can see, this is a very simple and actually works with any focus mode change. If you don’t like using the control center, you could easily create Shortcuts and map them to the iPhone action button. You can easily adapt this post to work with other focus modes. I no longer have any iOS 26 devices, but most of this post should still work.Â
Home Assistant Helper Entity
Although I focus on the sleep focus mode in this post, the same triggers can be used any iOS focus mode. If you want to trigger Home Assistant automations based on more than one focus mode, just create more helper entities, one per focus mode and name them accordingly. You will also need separate Shortcut automations for each focus mode.
The first step is to create Home Assistant helper entity (input_boolean) that will track the state of the sleep focus mode (or any focus mode). Then within Home Assistant you can use this boolean helper to trigger automations.Â
- In Home Assistant go to Settings -> Devices & services -> Helpers. Select CREATE HELPER.
- Select the Toggle option. Give the Toggle a name (e.g. Sleep Focus Mode) and pick an icon. Click CREATE.
Focus Mode ON Automation
Please make sure the Home Assistant companion app is installed wherever you are making this shortcut. If you want to download my prebuilt Shortcut from iCloud click here. Note: For Sleep mode you will need make the automation on iPadOS 27 or macOS Tahoe, then enable it on iOS 27. All other focus modes work on iOS 26 and later.Â
- On your device open the Shortcuts app.
- Under Library tap on Automation.Â
- Tap on the + button to create a new automation.
- Tap on Edit (iOS 27) or Edit Actions (iPadOS 27).
- Tap Automation, then tap Focus.Â
- Tap Do Not Disturb and select the Focus Mode you want to use. For Sleep mode you will need make the automation on iPadOS 27 or macOS Tahoe.
- Add another action and search for Home Assistant.Â
- Look for the Control switch action. Tap Choose.Â
- Find the boolean helper you created and tap on it.
- Tap Target State to turn the switch on.
- Tap on the Shortcut name at the top and give it a name (e.g. HA – Sleep Focus ON). Change the color and icon if you want.
- Run the automation and verify in Home Assistant that the boolean helper state changes to ON.
Focus Mode OFF Automation
This is the same procedure as above, just with the opposite action. If you want to download my prebuilt Shortcut from iCloud click here.
- On your device open the Shortcuts app.
- Under Library tap on Automation.Â
- Tap on the + button to create a new automation.
- Tap on Edit (iOS 27) or Edit Actions (iPadOS 27).
- Tap Automation, then tap Focus.Â
- Tap Do Not Disturb and select the Focus Mode you want to use.Â
- Tap Turned On, then tap Is Turned Off.Â
- Add another action and search for Home Assistant.Â
- Look for the Control switch action. Tap Choose.Â
- Find the boolean helper you created and tap on it.
- Tap Target State and leave the switch off.
- Tap on the Shortcut name at the top and give it a name (e.g. HA – Sleep Focus OFF). Change the color and icon if you want.
- Run the automation and verify in Home Assistant that the boolean helper state changes to OFF.
Home Assistant Automations
Now that all of the configuration has been done on your iPhone, we can now turn to Home Assistant. The sky is the limit here, so I’m just showing you one example of what you can do. I’ve included the YAML, which can be fully edited in the visual editor. Just create a new automation, switch to YAML view and paste the code. Switch back to the Visual mode and change the entities as needed.Â
Using the new 2026.7 Home Assistant automation interface I created an automation called “Master Bedroom – Good Night” which is triggered by the sleep focus mode boolean entity turning on. It also checks that I’m actually home, by making sure my person entity is in the “Home” zone. I then have it turn off all of the lights in the master bedroom, master bathroom, closet, and close the blinds. You could also build a scene and just call the scene.Â
alias: Master Bedroom - Good Night New
description: ""
triggers:
- trigger: switch.turned_on
target:
entity_id: input_boolean.sleep_focus_mode
options:
for: "00:00:00"
conditions:
- condition: zone.in_zone
target:
entity_id: person.derek_seaman
options:
for: "00:00:00"
zone: zone.home
actions:
- action: cover.close_cover
metadata: {}
target:
area_id: master_bedroom
data: {}
- action: cover.close_cover
metadata: {}
target:
area_id: mb_closet
data: {}
- action: light.turn_off
metadata: {}
target:
area_id: master_bedroom
data: {}
- action: light.turn_off
metadata: {}
target:
area_id: master_bathroom
data: {}
- action: light.turn_off
metadata: {}
target:
area_id: mb_closet
data: {}
mode: single
Summary
In this article I showed you how to create Home Assistant automation triggers based on any focus mode of your iPhone changing . This works with all focus modes, with the caveat that in the iOS 27 beta 3 you need to do a workaround to use the sleep focus mode. Hopefully Apple will fix this before the final release in September 2026. Â



