Bugsounet Coding

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular

    Recpie Question?

    Recipes
    3
    13
    199
    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.
    • K
      Kala Donators last edited by bugsounet

      Hi guys i wrote a Recpie but if i start MM Fatal error recepie ligtcontrol.py come on the display

      i checked my recpie but cant finde the mistake can you guys spot it?

      //Backgroundlightning v.1
      var recipe = {
        transcriptionHooks: {
          "GA_GPIO_true": {
            pattern: "licht bitte ein",
            command: "GA_GPIO_true"
          },
          "GA_GPIO_false": {
            pattern: "licht bitte aus",
            command: "GA_GPIO_false"
          },
      
        },
      
        commands: {
          "GA_GPIO_true": {
            soundExec: {
              chime: "open",
            },
            shellExec: {
              exec: "/home/pi/MagicMirror/lighton.py"
            }
          },
          "GA_GPIO_false": {
            soundExec: {
              chime: "close",
            },
            shellExec: {
              exec: "/home/pi/MagicMirror/lightoff.py"
            }
          },
        }
      }
      
      
      
      exports.recipe = recipe // Don't remove this line.
      

      Edit  [@bugsounet]: add js code tag

      1 Reply Last reply Reply Quote 0
      • K
        Kala Donators last edited by

        my goal with this recpie is to say “licht bitte ein” and it starts a pythonscript

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

          naturally it’s possible !

          but it’s need some manipulation 😕

          1 Reply Last reply Reply Quote 0
          • K
            Kala Donators last edited by

            what i have to add or change?

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

              1. ask the assistant to repeat the desired sentence

              sample:
              Jarvis (or ok google) … repeat afte me: licht bitte ein

              “repeat after me” or equal in your language

              1. turn off your mirror
              2. navigate to : ~/MagicMirror/modules/MMM-GoogleAssistant/tmp
                you will see and .mp3 file
                you can play it … Wow ! it’s the last reponse of google !!!
              3. copy this file to an usb key (or transfert it with ftp or else …)
              4. go to your computer
              5. open with an sound editor
              6. delete the not needed content (“You have says …” in english)
              7. save your new mp3 file

              Repeat it for next recipe response
              when done … I will explain what you have to add in your recipe 🙂
              just beep me 🙂

              when done humm… 95% of job done !

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

                1. upload for mp3 files to ~/MagicMirror/modules/MMM-GoogleAssistant/resources directory
                2. now we don’t use chime feature in soundExec. We will use sound !
                3. transform chime to sound

                From:

                ...
                     soundExec: {
                        chime: "open",
                      },
                ...
                

                to:

                ...
                     soundExec: {
                        sound: "you file.mp3",
                      },
                ...
                
                1. save your recipe !
                2. restart your mirror !
                3. ‘et voila!’
                1 Reply Last reply Reply Quote 0
                • bugsounet
                  bugsounet Main Coder last edited by bugsounet

                  😮

                  I just see that is not your question 😕

                  you have forget the python command !

                  //Backgroundlightning v.1
                  var recipe = {
                    transcriptionHooks: {
                      "GA_GPIO_true": {
                        pattern: "licht bitte ein",
                        command: "GA_GPIO_true"
                      },
                      "GA_GPIO_false": {
                        pattern: "licht bitte aus",
                        command: "GA_GPIO_false"
                      },
                  
                    },
                  
                    commands: {
                      "GA_GPIO_true": {
                        soundExec: {
                          chime: "open",
                        },
                        shellExec: {
                          exec: "python /home/pi/MagicMirror/lighton.py"
                        }
                      },
                      "GA_GPIO_false": {
                        soundExec: {
                          chime: "close",
                        },
                        shellExec: {
                          exec: "python /home/pi/MagicMirror/lightoff.py"
                        }
                      },
                    }
                  }
                  exports.recipe = recipe // Don't remove this line.
                  

                  don’t forget to verify if the path is correct of exec is correct

                  in all case you can tunning the response ! 😁 😁

                  1 Reply Last reply Reply Quote 0
                  • K
                    Kala Donators last edited by

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • K
                      Kala Donators last edited by

                      it worked out 🙂 thx very much

                      1 Reply Last reply Reply Quote 0
                      • K
                        Kala Donators last edited by

                        just a Question because im interested i have an idea to make PIR sensor who detects me and triggers GA to say: “Hello How are you”
                        is that possible?
                        with the recepies?

                        1 Reply Last reply Reply Quote 0
                        • K
                          Kala Donators last edited by

                          its like revers what i did. i have to read a GPIO to turning HIGH and after it triggers GoogeAssistans to say something.
                          Or i write a recpie who autostart a script. the main function of the scrip is waiting to turn a GPIO HIGH. If a GPIO is HIGH it starts a mp3 file
                          maybe a easier way?

                          ? 1 Reply Last reply Reply Quote 0
                          • ?
                            A Former User @Kala last edited by

                            This post is deleted!
                            1 Reply Last reply Reply Quote 0
                            • ?
                              A Former User last edited by

                              This post is deleted!
                              1 Reply Last reply Reply Quote 0
                              • Referenced by  A abdelhadj 
                              • First post
                                Last post
                              Powered by NodeBB | @bugsounet ©2022