Solved Google assistant for on and off
-
Can we use Google assistant for turn on and off magic mirror?
-
I think you just want to turn ON/OFF the screen ==> so you can use the plugin EXT-ScreenManager
I’ve add a custom recipe that launch a bash command to manually force the screen alimentation.
Here is the content of the sh script :
ScreenON.sh ==> vcgencmd display_power 1
ScreenOFF.sh ==> vcgencmd display_power 0
I’ve saved my files in /MagicMirror/modules/MMM-GoogleAssistant/scripts/But no need anymore, with the EXT-ScreenManager because on the wake up word the screen turns ON
in transcriptionHooks :
"SCREEN_ON": { pattern: "wake up", command: "SCREENON" }, "SCREEN_OFF": { pattern: "go to sleep", command: "SCREENOFF" },
In commands :
"SCREEN_ON": { shellExec: { exec: (params, key) => { return "~/MagicMirror/modules/MMM-GoogleAssistant/scripts/screenon.sh" }, options: (params, key)=> { return "" }, } }, "SCREEN_OFF": { shellExec: { exec: "~/MagicMirror/modules/MMM-GoogleAssistant/scripts/screenoff.sh", options: null, } },
-
@pitchx Hi, I’m an amateur hobbyist in MM, barely know anything about coding. How exactly would you format it in the MM config.js file? From the modules wiki, bugsounet only explained EXT-ScreenManager with cron format within defined hours. It would be great to turn on and off the screen with voice command.
Thank you,
Mike -
It’s exactly what i’m explainig to you
With screenmanager the screen turns ON on the detection of the hotword but if you want you can add the script I’ve mentionned to force turning ON or OFF the screen when you say your pattern in my exemple : “wake up” and “go to sleep”
to add your own recipe you have to create the file into the recipe folder and add it in your config.js into the config of module: “MMM-GoogleAssistant”
recipes: ["recipe_yourrecipe.js"]
-
@pitchx Thank you very much. I have never created a recipe before. I looked up other recipe samples and finally understood what you meant.
-
@mikecheng2626 can you post the example recipe link here for reference. Because I am also haven’t created any recipes before.
-
-
@bugsounet you rocks !!
-
@ganesh bugsounett just did with a sample
-
i have created a recipe and sved it in the recipes folder. And then I added the recipe in config.js file. But Google assistant doesn’t detect the words “wake up” & " go to sleep" .
-
put GA in debug mode to check if the word is hooked up
-
@pitchx in which destination the log file will be saved?
-
$HOME/.pm2/logs/MagicMirror-out.log
-
@pitchx how to check whether the GA is in debug mode or not.
Then how to view the log file? -
change your config.js restart your MM and then you read the log
-
After restarting the smart mirror it shows error loading recipe file. How to rectify it?
-
You have certainly made a syntax error , give your log that point the error and your config.js modification
-
bugsounet