MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-Hotword (v2) - whole-new-built

    Scheduled Pinned Locked Moved System
    21 Posts 5 Posters 11.0k Views 5 Watching
    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.
    • ? Offline
      A Former User
      last edited by

      MMM-Hotword

      MMM-Hotword is a hotword detector using snowboy.
      You can use this module to wake another voice assistant or to give a command to other module.

      Screenshot

      screenshot

      UPDATES

      2.0.0 (2019-05-19)

      • Whole new build-up
      • Some annoying dependencies are removed.
      • Installer is provided. (installer/install.sh)
      • Personal model trainer is provided. (trainer/trainer.sh)
      • Continuous recording after hotword detection is supported (Now you can say like “Computer, volume up” without pausing between Computer and volume up)
        • This feature could be used with MMM-AssistantMk2 ver3.x(Not yet released, but will arrive soon)
        • Or you can use this feature with other AI or Speech-To-Text program.
      • Simple standalone commands could be available. (Without any Assistant or Speech-To-Text, you can make own voice commands with this module standalone.). Commands could be combined sequence (You can make “volume-louder” with voice models “volume” and “louder”)
      • More universal models are added. (computer, subex, hey extreme and more.)
      • Hotword detected could be displayed on screen of MM.

      Download

      [card:eouia/MMM-Hotword]

      Last Tested; (2019-05-19)

      • MagicMirror : v2.7.1
      • Tested Environment :
        • Raspbian Stretch (Raspbian 3B+) / node v8.16.0 / npm v6.4.1
        • TinkerOS (TinkerBoard)
        • Ubuntu 18.04 (NVIDIA Jetson Nano)
        • OSX 10.14.4 (Apple MacBookPro) / node v11.12.0 / npm v6.7.0
      S 1 Reply Last reply Reply Quote 3
      • ? Offline
        A Former User
        last edited by

        Now you don’t need MMM-AssistantMk2 to make a simple command to handle MM. (But if you want, it’s your choice.) Standalone MMM-Hotword can control MM with your voice simply.

        1 Reply Last reply Reply Quote 1
        • L Offline
          Lowis
          last edited by

          Hi @Sean installed without problems. Great rebuild of MMM-Hotword !

          1 Reply Last reply Reply Quote 0
          • S Offline
            smarthome @Guest
            last edited by smarthome

            @Sean Tks for your great work job.
            I use hotword to do a lot of thing with smart mirror. But still have a problem bellow:
            I’d like to setup a lock function that hide all modun bellow a background screen and waitting only 1 hotword to show it again
            Everything seem OK. But when locked, other hotword to interactive with modules still effect in background and lock function can’t prevent this
            My question is How to temporary disable all hotword until it unlocks again? Tks!

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

              @smarthome
              Well, hiding/revealing mechanism is only to call hide/show methods of target modules. During its hiding, what to be done or not will be the responsibility of that target module itself. If some module should be not working during hiding, it is the business of that module.

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                smarthome @Guest
                last edited by

                @Sean

                Is there any “while…do” structure for using “hotword”, if have, we can do this lock function that temporary disable hotword

                for example, the hotword to work with MMM Assistant MK2 is “google”

                the hotword to lock is “lock_now”, the hotword to unlock is “hello123”

                hotword lock detect procedure is background running

                The structure is:

                while  
                {
                (("hotword lock detect procedure" )not equal to "lock_now" ) && ("hotword lock detect procedure" )not equal to "unlock_now" ) 
                }
                do
                {
                - setup hotword "google" to interactive  MMM Assistant MK2 
                }
                
                ? 1 Reply Last reply Reply Quote 0
                • ? Offline
                  A Former User @smarthome
                  last edited by A Former User

                  @smarthome
                  In some modules of mine (MMM-Clap and MMM-GroveGestures…) have commandsMode or commandSet for different command sets by condition, but not this. I think it could be considerable for your needs. But anyway, I’m quite busy nowadays, so cannot support it immediately.

                  S 1 Reply Last reply Reply Quote 0
                  • S Offline
                    smarthome @Guest
                    last edited by smarthome

                    @Sean
                    Can I send double notificationExec to 2 Module with ony 1 hotword
                    1st to MMM Page-Selector
                    2nd to Assistant MK2 speaks about this action

                    "open_news": {
                    notificationExec: {	
                    notification: "PAGE_SELECT",
                    payload:1
                    notification: "ASSISTANT_SAY",
                    payload:"Open News page"
                    restart:true,			
                    				},
                    

                    Also combine

                    "open_news": {
                    				notificationExec: {			
                    					notification: {"PAGE_SELECT","ASSISTANT_SAY"}
                    					payload:(1,"Open News page"}				
                    					},
                    				restart:true,			
                    				},
                    

                    But in real test, only ASSISTANT_SAY can be executed

                    How can I do that for both?

                    Tks!

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

                      @smarthome
                      With only notificationExec of MMM-Hotword, you can send only one notification.
                      There are 2 solutions.

                      1. Use MMM-NotificationTrigger, it can fire several notifications at a time by one trigger.
                      2. You can use moduleExec to call inner methods directly.
                      moduleExec: {
                        module: [],
                        exec: (module) => {
                          if (module.name == "MMM-Page-Selector") {
                            module.notificationRecieved("PAGE_SELECT", 1)
                          }
                          if (module.name == "MMM-AssistantMk2") {
                            module.notificationRecieved("ASSISTANT_SAY", "Open News Page")
                          }
                        }
                      }
                      

                      (not tested code, but you can catch the concept. You can use sendNotification from sender module instead using notificationReceived of target module)

                      PS AMK2 has some TTS-like feature(ASSISTANT_SAY) but I recommend you to use dedicated TTS modules like MMM-TTS or MMM-GoogleTTS.

                      S 1 Reply Last reply Reply Quote 0
                      • S Offline
                        smarthome @Guest
                        last edited by smarthome

                        @Sean
                        1/Could you give me the code in MMM Notification Trigger

                        2/Your code with ModuleExec didn’t work

                        3/I’m considering to use MMM TTS/Google TTS, but woud like to l try the simple solution first

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

                          @smarthome

                          {
                            module: "MMM-NotificationTrigger",
                            config: {
                              triggers:[
                                {
                                  trigger: "PAGE_SELECT_1",
                                  fires: [
                                    {
                                      fire: "PAGE_SELECT",
                                      payload: (pl) => {return 1}
                                    },
                                    {
                                      fire: "ASSISTANT_SAY",
                                      payload: (pl) => {return "ASSISTANT_SAY"}
                                    }
                                  ]
                                }
                              ]
                            }
                          },
                          

                          PAGE_SELECT_1 from notificationExec of Hotword.

                          S 1 Reply Last reply Reply Quote 0
                          • S Offline
                            smarthome @Guest
                            last edited by smarthome

                            @Sean
                            Your notification code didn’t work. Nothing happen :(
                            Could you check it again, pls

                            payload: (payload) => { //OPTIONAL. transform received payload to what your target module wants.
                            

                            You mean that: MMM Notification transform only, can not modify the payload then transform?

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

                              @smarthome
                              Well, check the log. and tell me whether suspicious logs be there.

                                fire: "PAGE_SELECT",
                                payload: (pl) => {return 1}
                              

                              is equivalent to .sendNotification("PAGE_SELECT", 1). whatever pl would come, it will be transfomed(or modified, whatever you want to call) and the fired notification would have 1 as payload.

                              S 1 Reply Last reply Reply Quote 0
                              • S Offline
                                smarthome @Guest
                                last edited by

                                @Sean
                                Finally, it worked, many thank for your help!

                                S 1 Reply Last reply Reply Quote 0
                                • S Offline
                                  smarthome @smarthome
                                  last edited by smarthome

                                  @Sean

                                  I created some hotwords by myself on https://snowboy.kitt.ai/ under .pmdl extension, then save to model folder in MMM Hotword
                                  After configure MMM-Hotword in MMM config file to use these hotwords, MMM-Hotword auto detect hotwords and do the action, why no input voice signal to mic, only noise…
                                  I tried to incrase hotword from 1 word to 2 words, one to multiple syllables, but cant not stop this issuse
                                  I’ve check the configuration, everthing is normal.
                                  What’s happen? How to fix that?

                                  Tks!

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

                                    @smarthome
                                    Did you use trainer.sh of the module to make your pmdl? or made it on snowboy website? pmdl is somewhat sensitive so, if you made it on another platform (e.g. your desktop pc) or other device(e.g different mic with your RPI’s), it might not work.
                                    Anyway, How do you figure out `only noise?

                                    G 1 Reply Last reply Reply Quote 0
                                    • G Offline
                                      guongthongminh @Guest
                                      last edited by

                                      @Sean
                                      I have built two hot words like this to call each page. I call the first page works, but by the time I call the second page is not working? Please point out the error and help me!
                                      alt text
                                      alt text

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

                                        @guongthongminh
                                        Well, you don’t need to use MMM-NotificationTrigger. I can’t understand why you use that. MMM-Hotword itself has the feature of emitting notification(You’re already using.)

                                        {
                                          fire: "HOTWORD_RESUME",
                                        },
                                        {
                                          fire: "HOTWORD_PAUSE",
                                        }
                                        

                                        It doesn’t make any sense at all. This means “HOTWORD_RESUME” and “HOTWORD_PAUSE” at a same time. Why this part be needed? This would make your MMM-Hotword being paused.

                                        1 Reply Last reply Reply Quote 0
                                        • B Offline
                                          Bronno
                                          last edited by

                                          mmm-hotword is working well for me. I created it with first with the website Snowboy, later to make it better with trainer.sh. Sensity 0.5, later 0.9. With my voice it is working well, but for any noice from my wife, youtube movie, mmm-screencash, clocksound etc Google Assistant is activated many times. Also when nothing is said - only some “noise”. The file that is created (when it is Not the hot word) is only a small part of a word/ some sound - but it creates a connection with GA. Any idea how I can make it better?

                                          ? 2 Replies Last reply Reply Quote 0
                                          • ? Offline
                                            A Former User @Bronno
                                            last edited by

                                            @Bronno

                                            Frankly says, not many options. There is always possibility of confusing with other sound sources(even noise)
                                            Not surprisingly, real commercial products like google home also misbehavior sometimes. Nobody is saying g of google, but google home be activated.
                                            However, not so may times. Because;

                                            • their detector is more dedicated to their own special pattern, which is result of advanced engineering and tech by google, amazon, apple,… ours are not such a level.
                                            • they use arrayed mic with phonetic/acoustic science. So they can determine direction, distance and dimension of each sound sources. So they can KNOW what is real voice from human in the room, not noise, not music, not too far, and even not the sound from speaker itself at that moment.

                                            Those are why they can detect precisely.

                                            1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post
                                            Enjoying MagicMirror? Please consider a donation!
                                            MagicMirror created by Michael Teeuw.
                                            Forum managed by Sam, technical setup by Karsten.
                                            This forum is using NodeBB as its core | Contributors
                                            Contact | Privacy Policy