How to run a macro by voice command?

Is there any configuration I need to do in Google Assistant?
I already tried to run with voice command.
"Run macro-test in macrodroid"
Did not run the macro test.
 

Tony Diep

New member
It doesn't work for me either. Assistant always does a web search for the phrase instead of asking Macrodroid to run the macro. macroids help days this should work.
 

NativeAlien

New member
How to run a macro by voice command?
I'm surprised more people have not leveraged the [voice input] action more. Recently I've been using this as a voice command trigger for a lot of my macros and it's dead simple.

Start by creating a global string variable to link all your macros together called 'voice input' in your variables tile in the main app.

Then create a simple macro that will be triggered by something accessible like a device shake, a quick tap or device squeeze if you have that function(you'll have to trigger it with a macrodroid shortcut as the action option in your OS if available), or even a media/ headset button trigger. I like using my Pixel's quick tap for this.

Use the [voice input] action to use the spoken string variable inputs & with all of your future macros you want triggered by these commands you just name the voice command you want to use in the [macrodroid variable changed] trigger, preferably with the [contains] option so you won't have to be super specific. This will make it to where you can use a LOCAL voice command(yes, this voice input action works with no internet connection) & it will trigger as many macros as you want with the [Macrodroid variable changed] trigger in any macro you like.

The great thing about this is that you can use this in even finer granular control flow scenarios where a variable change can be leveraged.
 

lamarque

New member
Hi all, I am new to the forum but I use MacroDroid since long ago. I have found a way to call macros using Google Assistant and wanted to share it with you. I use what NativeAlien described in the last message together with a "Application Launched: MacroDroid" trigger. It can be any app since Google Assistant is able to launch any app in any language as far as I could test. Then when I say "Ok Google, open MacroDroid", MacroDroid is oppened, the trigger is fired, then comes those actions: 1. "Wait 3 seconds", 2. "Speak Text: ready", 3. "Voice Input: temp", 4. "If temp = disable voice input", 5. "Disable Macro: This Macro", 6. "Cancel Macro Actions: This Macro", 7. "End If", 8. "Press Back Button", 9. "Clear Variables: voiceInput", 10. "Set Variable: voiceInput: {lv:temp}". Here are some explanations for some of these actions:

1. the 3 wait is required so Google Assistant finishes speaking before "Voice Input" action starts.
2. the "ready" speak is just for me to know when the 3 seconds wait has finished.
3. I use a temp local variable so I can change it inside this macro for other actions. Anyone could use the glocal voiceInput variable instead througout the macro.
4 to 7 disable this macro to prevent the "Press Back Button" action so I can use MacroDroid. I can also click on the disable Macrodroid switch in the top right corner and re-enable MacroDroid when I finish configuring it.
8 this is required so MacroDroid's window does not interfere with other apps.
9 and 10 force "MacroDroid Variable Change" trigger to be fired even when I speak the same text again.

All that works wonderfully for me, the only two annoying things are the 3 seconds wait and the fact that MacroDroid's Voice Input only works with the system language. My mother tongle is Brazilian Portuguese but I usually set my smartphone and notebook to use English (long history), now I have to set it to Brazilian Portuguese to use my macro. I know it is possible to select language in "Speak Text" action. Could MacroDroid's developers add something like that for the "Voice Input" action?

PS: really nice catch from NativeAlien. Thanks for the idea.
 

Endercraft

Moderator (& bug finder :D)
I'm pretty sure it's Google who hasn't implemented other languages than English for other apps.
 
Top