I’d like to enable android focus mode on my phone when my phone is in my office. I can already detect the latter with ble tracking.
I currently use android wellbeing app for focus mode on my phone, which can be enabled and disabled in the quick settings menu of my phone. However, there are also other apps available that could be used, for example “Stay Focused”
In know there are a few things I can trigger on my phone from home assistant, with notification commands, like toggling dnd mode, which comes close (and I already use it when the phone is in my bedroom).
I thought I might be able to do it by broadcasting an intent? But I don’t know what to send
I could not find how tasker could do this. I found that tasker is able to enable focus mode, but not to disable focus mode. That seems to be a limitation of the digital wellbeing app.
What I ended op doing is the following
I created a scene in tasker that is a fullscreen black page with just the word “focus!”
I created a profile in tasker that shows the scene whenever the screen is unlocked
I created another profile that turns on the previous profile when a system intent is received with the action “FOCUS_ENABLE”
I created yet another profile that turns it off on “FOCUS_DISABLE”
In Home Assistant, in an automation, I can send a “command_broadcast_intent” message: