Bugsounet Coding

    • Register
    • Login
    • Search
    This Forum is now reserved to registred users!

    Solved Google assistant for on and off

    Issues
    4
    17
    131
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      ganesh last edited by

      Can we use Google assistant for turn on and off magic mirror?

      1 Reply Last reply Reply Quote 0
      • pitchx
        pitchx BetaTester Helpers last edited by pitchx

        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,
             }
           },
        
        M 1 Reply Last reply Reply Quote 0
        • M
          mikecheng2626 Donators @pitchx last edited by

          @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

          1 Reply Last reply Reply Quote 0
          • pitchx
            pitchx BetaTester Helpers last edited by

            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"]
            
            M 1 Reply Last reply Reply Quote 0
            • M
              mikecheng2626 Donators @pitchx last edited by

              @pitchx Thank you very much. I have never created a recipe before. I looked up other recipe samples and finally understood what you meant.

              G 1 Reply Last reply Reply Quote 0
              • G
                ganesh @mikecheng2626 last edited by

                @mikecheng2626 can you post the example recipe link here for reference. Because I am also haven’t created any recipes before.

                M 1 Reply Last reply Reply Quote 0
                • bugsounet
                  bugsounet Main Coder last edited by

                  sample

                  1 Reply Last reply Reply Quote 0
                  • pitchx
                    pitchx BetaTester Helpers last edited by

                    @bugsounet you rocks !!

                    1 Reply Last reply Reply Quote 0
                    • M
                      mikecheng2626 Donators @ganesh last edited by

                      @ganesh bugsounett just did with a sample

                      1 Reply Last reply Reply Quote 0
                      • G
                        ganesh last edited by

                        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" .

                        1 Reply Last reply Reply Quote 0
                        • pitchx
                          pitchx BetaTester Helpers last edited by

                          put GA in debug mode to check if the word is hooked up

                          G 2 Replies Last reply Reply Quote 0
                          • G
                            ganesh @pitchx last edited by

                            @pitchx in which destination the log file will be saved?

                            1 Reply Last reply Reply Quote 0
                            • pitchx
                              pitchx BetaTester Helpers last edited by

                              $HOME/.pm2/logs/MagicMirror-out.log
                              
                              1 Reply Last reply Reply Quote 0
                              • G
                                ganesh @pitchx last edited by

                                @pitchx how to check whether the GA is in debug mode or not.
                                Then how to view the log file?

                                1 Reply Last reply Reply Quote 0
                                • pitchx
                                  pitchx BetaTester Helpers last edited by

                                  Wiki is here for that

                                  change your config.js restart your MM and then you read the log

                                  1 Reply Last reply Reply Quote 0
                                  • G
                                    ganesh last edited by

                                    After restarting the smart mirror it shows error loading recipe file. How to rectify it?

                                    1 Reply Last reply Reply Quote 0
                                    • pitchx
                                      pitchx BetaTester Helpers last edited by

                                      You have certainly made a syntax error , give your log that point the error and your config.js modification

                                      1 Reply Last reply Reply Quote 0
                                      • Topic has been marked as solved  bugsounet bugsounet 
                                      • First post
                                        Last post
                                      Powered by NodeBB | @bugsounet ©2022