IOS 15 focus sensor

Hi

I read in the IOS app changelog about a new sensor: focus.binary.
It does not work, only states false or off on my phone.
I gave all permissions, but still not updating iphone focus status to the HA app.

Anyone noticed this?

1 Like

Can you confirm that Focus Permission is enabled in the App Configuration > Sensors? This will not be prompted automatically until 2021.11 (didnā€™t have time to get this part done) so youā€™ll need to manually get permission there.

If that doesnā€™t work, can you confirm that Home Assistant is not in the ā€œAllowed Appsā€ list for notifications? This is noted in the docs but itā€™s not the most obvious limitation. The system will not report focus status to the app if it is in that list. You can work around this by sending notifications that you care about as ā€˜time sensitiveā€™ interruption level.

Is it possible for a future version to include the name of the focus mode which is active, even as an attribute on the existing binary sensor?

Iā€™d like to automate my driveway gate opening/closing when I leave but it would need to know that it is in the driving focus specifically to work. I donā€™t want it to open when Iā€™m walking home for instance.

4 Likes

Unfortunately Apple does not make accessible to the app which focus status is active.

1 Like

Bummer. I was afraid of that. Hopefully that changes in the futureā€¦

You can create a Shortcuts Automation that triggers on a modeā€™s turning on/off and use that to call an input_boolean service to track the modeā€¦ it risks desynchronization but it seems pretty reliable so far.

3 Likes

Yeah I may have to do that until a better solution reveals itself

1 Like

With iOS 16 Focus Filters, maybe something has changed here.

Relevant Apple docs: Apple Developer Documentation

Some related questions on the Apple Developer forums: Where is the Focus Status API | Apple Developer Forums

In case anyone else is trying to find a way to make this work.

3 Likes

Hopefully this will be allowed soon. Being able to read focus status is BIG for automations.

3 Likes

Any updates on being able to get the Focus mode name? Anything in the upcoming 2023 OS releases that enable this?

1 Like

Also really hoping we get focus mode names :slight_smile:

2 Likes

I donā€™t know if itā€™s still an issue for you, but I found a way to get the focus status updated.
In the iOS settings under Focus ā†’ Focus Status you have to activate the sharing of the status and (thatā€™s what made it work for me) the sharing of ā€œDo not Disturbā€.
Now home assistant updates the focus status normally.

I have found that the only focus mode that reports to the HA app focus sensor is the do not disturb focus non of the custom ones or sleep focus report in a way that triggers the sensor