I’ve completely rewritten my blog post on how to trigger Home Assistant automations based on iOS Focus mode state changes. You could do way more than just trigger automations, but this will get you started. It was written for iOS 27, but most should work on iOS 26.