Question about simple on/off Macro for DND via Bluetooth Device

Chaybee

New member
Hi all,

I'm brand new to this so please forgive me if this question is fundamentally easy; I just cannot for the life of me figure it out.

Simply - I have a Macro set up to put my phone into DND when a specific Bluetooth device (earbuds) connects. I then have a second Macro to turn off DND when the earbuds disconnect. These work perfectly, however, I just know I must be missing something to have these simple automations run via a single Macro. Thanks for any insight!
 

hsurB

Well-known member
You need to use if clause (action) add trigger fired as constraint to that if clause and then add set of actions that are supposted to be performed when said trigger fires, then you click that if clause, click add if/else and do the same for other triggers or just create another if clause (what might look worse) but allows to copy all different sets of actions separately
 

Chaybee

New member
You need to use if clause (action) add trigger fired as constraint to that if clause and then add set of actions that are supposted to be performed when said trigger fires, then you click that if clause, click add if/else and do the same for other triggers or just create another if clause (what might look worse) but allows to copy all different sets of actions separately
Thank you for the response. I'll have to wrap my head around understanding what you just wrote as it's a bit over my head at the moment but good to know it can be accomplished. I'll have to search the forum to see how to add the IF clause and other options you described. I'm used to Goggle Home, Alexa, IFTTT and some Google Home Script Editor Routines language so learning the equivalent terms is something I need to do.
 

hsurB

Well-known member
Thank you for the response. I'll have to wrap my head around understanding what you just wrote as it's a bit over my head at the moment but good to know it can be accomplished. I'll have to search the forum to see how to add the IF clause and other options you described. I'm used to Goggle Home, Alexa, IFTTT and some Google Home Script Editor Routines language so learning the equivalent terms is something I need to do.

Here you have it, but you need to change triggers and actions.
I showed both cases, first creating two different if clauses and the 3rd one does the same what these two first ones.
So in the end you either delete first and second one or only the 3rd one
 

Attachments

  • Forum10.png
    Forum10.png
    239.4 KB · Views: 6
  • Forum10.macro
    3.5 KB · Views: 2

Dm114

Well-known member
Here you have it, but you need to change triggers and actions.
I showed both cases, first creating two different if clauses and the 3rd one does the same what these two first ones.
So in the end you either delete first and second one or only the 3rd one
Oh wow, thank you! Seeing the visual actually puts things into a better perspective.
Instead of using multiple IF...ENDIF statements, you'd better use one
IF...
ELSE IF...
ELSE IF...
ELSE IF...
ENDIF

It's more efficient because if the 1st clause is True, it won't test the 2nd, nor 3rd one if they are exclusive to each other.
 

Chaybee

New member
Instead of using multiple IF...ENDIF statements, you'd better use one
IF...
ELSE IF...
ELSE IF...
ELSE IF...
ENDIF

It's more efficient because if the 1st clause is True, it won't test the 2nd, nor 3rd one if they are exclusive to each other.
Hmmm...I literally just need "IF" bluetooth earbuds connect to BT, turn on DND and "IF" earbuds disconnect from BT, "THEN" turn DND off. So that seems to me like it would only be one IF and then one ELSE IF? Still learning this. Confused my ENDIF also but I'm reading some threads.
 

hsurB

Well-known member
Hmmm...I literally just need "IF" bluetooth earbuds connect to BT, turn on DND and "IF" earbuds disconnect from BT, "THEN" turn DND off. So that seems to me like it would only be one IF and then one ELSE IF? Still learning this. Confused my ENDIF also but I'm reading some threads.

He meant its better to use 3rd if clause from my exemple than using two first ones separately.
I agree but I showed both cases anyway
 

Qarboz

Well-known member
Thank you for the response. I'll have to wrap my head around understanding what you just wrote as it's a bit over my head at the moment but good to know it can be accomplished. I'll have to search the forum to see how to add the IF clause and other options you described. I'm used to Goggle Home, Alexa, IFTTT and some Google Home Script Editor Routines language so learning the equivalent terms is something I need to do.
For your request you have already been answered. But if you want to learn how to use MacroDroid, I suggest you first read the Wiki
Then read the forum to find tricks and ideas. If you don't find what you need you can ask in the forum, there is always someone willing to help
 
Top