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?

2 Likes

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.

2 Likes

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.

4 Likes

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

4 Likes

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

3 Likes

Also really hoping we get focus mode names :slight_smile:

4 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

1 Like

Where do I go in the Home Assistant app to see the focus mode status and name?

When any of the focus modes is activated, HA focus sensor goes on. Iā€™ve tested it on my iPhone 14, and this sensor goes on even when Iā€™m driving.

It would be nice if HA developers add mode name as an attribute to this sensor, for example binary_sensor.iphone_14_edison_focus: on attr_mode: driving, sleeping, working or whatever name of a custom focus mode.

3 Likes

Only status, currently there is no ā€œmode nameā€ attribute for this sensor