Setting Android phone to Do not disturb mode from HA?

Hey, I’m pretty new to Home Assistant and I would like to activate Do not disturb mode on my Android phone (where I installed the companion app). Reading Do not disturb state is definitively possible but can it be changed from HA?

I would like to add it to my Good night/Good morning routine. I tried doing this directly with Alexa but I’m afraid Alexa only can change Echo devices.

The app can’t do this, but with Tasker it’s probably doable.

Definitely doable with Tasker. It would be in the Audio action category when creating the Task. I use Tasker to turn on and off my Sleep Tracker (Sleep with Android) with my Goodnight Routine every night. Could easily add DND to that Task if I wanted.

1 Like

I see this get asked about a lot, it seems like toggling DND is a very popular command compared to anything else on an android device eh?

I don’t know, I just see it sensible and convenient.

I finally made it with Alexa and IFTTT; it’s not a true DND, but it’s something.

Even though I would have loved to make it with only HA.

Good day,

I was able to get this to work on my Pixel 5 using the Home Assistant application and following the process defined at Notification Commands | Home Assistant Companion Docs - worked great. Now when I am at the church building my phone goes into “priority_only” mode - so cool!

HA rocks!

  • CoyoteRay

PS: Tasker is also very nice and I will recommend it to others.

7 Likes

Hello! In case anyone was interested, I also followed the document that @CoyoteRay linked to here and it worked perfectly, running Android 13. My use case was a bit different. I wanted to force my phone out of DND mode when a flood sensor detected an issue (say, in the middle of the night when you least expect it!). In that case, you send a separate message first to your phone, and set your command_dnd data to “off” and then send the notification you want to see on your phone after that.

Worked flawlessly once I sent the initial DND push command to allow DND access to my phone via the companion app. Thanks again

I just added this Do Not Disturb to one of my automations at night. What would be awesome (but not yet supported) would be to also disable the ‘tilt to wake’ on Wear OS watches since I currently turn on ‘theatre mode’ during the night whilst using the watch for sleep monitoring.