Page 1 of 1

How do I check for Do Not Disturb mode and disable it?

Posted: 01 Dec 2018 23:00
by teiji
Hello, I'm trying to write a flow that will check for a certain notification + if Do Not Disturb (DND) mode is on, then it will disable it. Which trigger do I use for DND check and which action to disable it? I search for it in the list but nothing comes close (unless I miss it). I see "Interruptions Mode" but not sure if this is DND mode or not. Please help.

Re: How do I check for Do Not Disturb mode and disable it?

Posted: 02 Dec 2018 03:32
by anuraag
Yes Interruptions Mode is for setting DND.
Use "Notification on Statusbar Displayed" as trigger and then "Interruptions Mode" as condition.

Flow will be like this

Trigger =>Notification on Statusbar Displayed
Condition =>Interruptions Mode

If true
Action => Set Interruptions Mode

But you want notification sound for that notification as your phone was on DND mode when that notification arrived, so you need another action

Action => Sound

Re: How do I check for Do Not Disturb mode and disable it?

Posted: 02 Dec 2018 05:17
by teiji
anuraag wrote:Yes Interruptions Mode is for setting DND.
Use "Notification on Statusbar Displayed" as trigger and then "Interruptions Mode" as condition.

Flow will be like this

Trigger =>Notification on Statusbar Displayed
Condition =>Interruptions Mode

If true
Action => Set Interruptions Mode

But you want notification sound for that notification as your phone was on DND mode when that notification arrived, so you need another action

Action => Sound
Thanks. So I'm guessing "None / Don't interrupt" is DND mode ON and "All / Always interrupt" is DND mode OFF?

Re: How do I check for Do Not Disturb mode and disable it?

Posted: 02 Dec 2018 05:35
by anuraag
Yes. You are correct.

Re: How do I check for Do Not Disturb mode and disable it?

Posted: 02 Dec 2018 15:18
by teiji
anuraag wrote:Yes. You are correct.
Thanks again. It works! You are awesome. :)

Re: How do I check for Do Not Disturb mode and disable it?

Posted: 18 Feb 2019 17:28
by drenze
anuraag wrote:Yes Interruptions Mode is for setting DND.
Use "Notification on Statusbar Displayed" as trigger and then "Interruptions Mode" as condition.

Flow will be like this

Trigger =>Notification on Statusbar Displayed
Condition =>Interruptions Mode

If true
Action => Set Interruptions Mode

But you want notification sound for that notification as your phone was on DND mode when that notification arrived, so you need another action

Action => Sound
My search for an answer to a similar question brought me here, and this ALMOST answers my question. However, I'm trying to use whether DND status is on as a CONDITION, so that if a different trigger occurs while DND is active, Y will happen. I suppose I could toggle a global variable each time DND is toggled, but that just seems so inelegant somehow.

I see that there is also a "Notification on Statusbar Displayed" condition, but I have to select a package name. I assume that the package to be selected is "settings," but from there...what?

Re: How do I check for Do Not Disturb mode and disable it?

Posted: 18 Feb 2019 17:55
by Desmanto
Interruptions Mode or DND comes in 2 flavors, trigger and condition. The one stated above is the condition version, which check for state, to be used with other triggers. If you need to trigger when the Interruption mode changes, use the trigger version instead.

But from what I understand from your comment, it seems you should use the condition version. But you want to use another trigger in another flow; probably you need to disable/enable flow based on the interruption mode.

Notification on Statusbar Displayed when used with package name, will only filter that package name. What kind of notification do you want to check? Not all notification comes only from settings. Maybe you are using notif from gmail, whatsapp or alarm clock. You should select the proper one, or you will missed out the notif. You can use my variable logger flow to log the possible notification you are looking for.

Re: How do I check for Do Not Disturb mode and disable it?

Posted: 18 Feb 2019 23:11
by drenze
You are correct, I want the condition version. It looked to me like you were using the trigger version, as I was able to follow your instructions using trigger. I was NOT, however, able to follow them using a condition, hence the confusion.