We have prepared several recipes.
recipes
directory of MMM-GoogleAssistantHow it's works ?
By reading the source of this recipe,
You can see there is 3 commands,
each command have a pattern (aska what do you have to say to activate the command)
For reboot your Pi
You have to say: reboot please
For restart MagicMirror
You have to says: restart please
This command is ONLY availabe if you use
pm2 app
for startingMagicMirror
shutdown please
Naturally, you can change
pattern
of eachtranscriptionHooks
for better using in accord with your language
/** with-status.js **/
/** send the status of assistant to a python script **/
/** For LED Strip for example **/
/** @bugsounet **/
var recipe = {
commands: {
"Status": {
shellExec: {
exec: (param) => {
return "python /home/pi/myscript.py " + param.status.actual
}
}
}
},
plugins: {
onStatus: "Status"
},
}
exports.recipe = recipe
I have defined in the with-status.js
sample
to run this command : python /home/pi/myscript.py Status_of_GA
in GA configuration, you have an recipe field
just add it
samples :
recipes: [ "with-status.js" ],
recipes: [ "with-status.js", "with-other-recipes.js" ],
for some other recipe needed
You have created your own recipe
Save it in recipes
folder of MMM-GoogleAssistant
add it in the recipes:[]
of the config
sample: You have save My_ownRecipe.js
recipes: [ "My_ownRecipe.js" ],
If you have already some recipes, just add it in the array
recipes: [
"My_ownRecipe.js",
"with-other-recipes.js"
],
Don't forget to restart MagicMirror !