MagicMirror² v2.13.0 is available! For more information about this release, check out this topic.

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

  • Module Developer


    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.




    2.0.0 (2019-05-19)

    • Whole new build-up
    • Some annoying dependencies are removed.
    • Installer is provided. (installer/
    • Personal model trainer is provided. (trainer/
    • 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.


    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

  • Module Developer

    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.

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

  • @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!

  • Module Developer

    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.

  • @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:

    (("hotword lock detect procedure" )not equal to "lock_now" ) && ("hotword lock detect procedure" )not equal to "unlock_now" ) 
    - setup hotword "google" to interactive  MMM Assistant MK2 

  • Module Developer

    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.

  • @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",
    notification: "ASSISTANT_SAY",
    payload:"Open News page"

    Also combine

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

    But in real test, only ASSISTANT_SAY can be executed

    How can I do that for both?


  • Module Developer

    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 ( == "MMM-Page-Selector") {
          module.notificationRecieved("PAGE_SELECT", 1)
        if ( == "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.

  • @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

Log in to reply