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 being on all the time (also MMM-AssistantMk2)

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    5 Posts 3 Posters 2.7k Views 3 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.
    • C Offline
      CarstenD
      last edited by

      I am using MMM-Hotword together with MMM-AssistantMk2 and MMM-NotificationTrigger.

      So far this works great but since some days I have the situation that after correctly recognizing the keyword the microphone stays open which leads to the situation that any following communication is also recognized by Google Assistant as input.

      Sometimes it even creates the situation that an answer spoken by Google Assistant is again recognized by Google Assistant as input - somehow as it would speak with itself.

      This is my config:

      {
            module: "MMM-NotificationTrigger",
            config: {
              triggers:[
                {
                  trigger: "HOTWORD_DETECTED",
                  fires: [
                    {
                      fire:"HOTWORD_PAUSE",
      
                    },
                    {
                      fire:"ASSISTANT_ACTIVATE",
      		delay: 200,
                      payload: function(payload) {
                        return {
                          "profile": payload.hotword
                        }
                      }
                    },
                  ]
                },
                {
                  trigger: "ASSISTANT_DEACTIVATED",
                  fires: [
                    {
                      fire:"HOTWORD_RESUME"
                    }
                  ]
                },
              ]
            }
      },
      
      {
        module: 'MMM-Hotword',
        config: {
          snowboy: [
      	{
      		//hotwords: "smartmirror", //this will be sent to other module for distinguishing which hotword is detected.
      		hotwords: "okhorst",		
      		file: "resources/models/OKHorst.pmdl",
      		sensitivity: '0.7',
      	},
      	{
      		hotwords: "snowboy",
      		file: "resources/models/snowboy.umdl",
      		sensitivity: '0.5',
      	},
      	{
      		file: 'resources/models/jarvis.umdl',
      		sensitivity: '0.8,0.80',
      		hotwords: ['jarvis','jarvis'] //Kitt.ai changed their Jarvis UMDL, it has 2 models in one file. So weird.
      		//anyway, you can give different name for each. ['jarvis_1', 'jarvis_2']. Even though I think this is useless.
      	}
          ],
          record: {
            sampleRate    : 16000,      // audio sample rate
            threshold     : 0.5,        // silence threshold (rec only)
            thresholdStart: null,       // silence threshold to start recording, overrides threshold (rec only)
            thresholdEnd  : null,       // silence threshold to end recording, overrides threshold (rec only)
            silence       : 1.0,        // seconds of silence before ending
            verbose       : true,      // log info to the console
            recordProgram : 'arecord',  // Defaults to 'arecord' - also supports 'rec' and 'sox'
            device        : null        // recording device (e.g.: 'plughw:1')
          },
          autostart: true,              // if 'false', this module will wait for 'HOTWORD_RESUME' notification to start hotwords detection at the beginning.
          autorestart: false,          // You can set this 'true' when you want this module to go back to listening mode automatically again after hotword is detected. But use this carefully when your other modules are using microphone or speaker.
        }
      },
      
      
      {
            module: "MMM-AssistantMk2",
            position: "bottom_right",
            config: {
      		deviceLocation: { // (OPTIONAL)
      			coordinates: { // set the latitude and longitude of the device (rf. mygeoposition.com)
      				latitude: 50.243430, 
      				longitude: 8.652580, 
      			},
      		},
      		defaultProfile: "default", // This default profile should be in `profiles` field.
      		profiles: 	{
      				"default" : 	{
      					profileFile: "default.json", //this path will be `~/MagicMirror/modules/MMM-AssistantMk2/profiles/default.json"
      					lang: "de-DE",
      					},
      				},
      
      
      		},
      },
      
      
      ? B 3 Replies Last reply Reply Quote 0
      • ? Offline
        A Former User @CarstenD
        last edited by

        @carstend
        You are right. that was not your fault.
        Sometimes Google cloud server sends voice-output after the conversation ends. The problem is, Google Assistant API has not significant current conversation end signal, and there is no definitive way to measure whether conversation ends or not. I think it could be better in next API. (Google Assistant API is beta currently.)

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

          @carstend And you can use multi-array mics for distinguishing your voice from other sounds(including GA itself), That is why real Google Home / Alexa / HomePod use multi-array mics.

          1 Reply Last reply Reply Quote 0
          • C Offline
            CarstenD
            last edited by

            Thank you for the fast answer. That makes sense since I did not change anything. I will play around a bit with the sensitivity and wait for Google API updates.

            BTW: Great modules!

            1 Reply Last reply Reply Quote 0
            • B Offline
              bachoo786 @CarstenD
              last edited by bachoo786

              Hi @CarstenD

              Can you please tel me what does this part of your config do?

              triggers:[
                        {
                          trigger: "HOTWORD_DETECTED",
                          fires: [
                            {
                              fire:"HOTWORD_PAUSE",
              
                            },
                            {
                              fire:"ASSISTANT_ACTIVATE",
              		delay: 200,
                              payload: function(payload) {
                                return {
                                  "profile": payload.hotword
                                }
              

              Thanks.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • 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