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

MMM-AssistantMk2



  • Hey!

    I have followd the MMM-AssistantMk2 guide and succefully build the module and installed everything. But I cannot figure out the last part. How to configure the mirrors configure.js

    what parameters and what should I place there? If I just copy the whole thing from the example its not working. When I start the mirror it just tells me to configure it. Could someone please paste a code that works for me please so I can try this module out.

    thanx in Advanced

    I did paste this whole thing to my config.js

    {
    module: “MMM-AssistantMk2”,
    position: “top_left”,
    config: {
    deviceModelId: “”, // (OPTIONAL for gaction)It should be described in your config.json
    deviceInstanceId: “”, // (OPTIONAL for gaction)It should be described in your config.json
    deviceLocation: { // (OPTIONAL)
    coordinates: { // set the latitude and longitude of the device (rf. mygeoposition.com)
    latitude: 51.5033640, // -90.0 - +90.0
    longitude: -0.1276250, // -180.0 - +180.0
    },
    },
    useScreen: true, // set this to true if you want to output results to a screen
    //showed contents will be hidden when new conversation starts or ASSISTANT_STOP_CONTENT is comming.

    screenZoom: "80%",
    	transcriptionHook: { //if you set hooking phrase here, this module will catch these words in your speech and emit ASSISTANT_HOOK notification.
    		/*
    		"SCREEN_OFF" : "screen off",
    		"SCREEN_ON" : "screen on",
    		"REBOOT" : "reboot",
    		"SHUTDOWN" : "shut down",
    		"TEST" : "test"
    		*/
    	},
    	youtube: {
    		use:true, //if you want to autoplay of youtube clip in responses of Assistance.
    		height: "480", //This is not real player size. It's for ideal player size for loading video. (related to video quality somehow.)
    		width: "854",
      notifyPlaying: false, // tell other modules whether youtube is playing or not.
    	},
    	auth: {
    		keyFilePath: "./credentials.json"
    	},
    	audio: {
    		encodingIn: "LINEAR16", // supported are LINEAR16 / FLAC (defaults to LINEAR16)
    		sampleRateIn: 16000, // supported rates are between 16000-24000 (defaults to 16000)
    		encodingOut: "LINEAR16", // supported are LINEAR16 / MP3 / OPUS_IN_OGG (defaults to LINEAR16), currently only LINEAR16 is implemented to output, others are not yet. so use LINEAR16.
    		sampleRateOut: 24000, // supported are 16000 / 24000 (defaults to 24000)
    	},
    	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: "en-US"
    			//currently available (estimation, not all tested):
    			//  de-DE, en-AU, en-CA, en-GB, en-US, en-IN
    			// fr-CA, fr-FR, it-IT, ja-JP, es-ES, es-MX, ko-KR, pt-BR
    			// https://developers.google.com/assistant/sdk/reference/rpc/languages
    		},
    		/* You can use multi-profile for your family.
    		"kids" : {
    			profileFile: "jarvis.json",
    			lang: "de-DE"
    		},
    		"myself_korean" : {
    			profileFile: "default.json",
    			lang: "ko-KR"
    		}
    		*/
    	},
    	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       : false,      // log info to the console
    		recordProgram : "arecord",  // Defaults to "arecord" - also supports "rec" and "sox"
    		device        : null        // recording device (e.g.: "plughw:1")
    	},
    },


  • If I put this into the config.js its not working either:

    {
    module: “MMM-AssistantMk2”,
    position: “top_left”,
    config: {}
    },

    what am I doing wrong?



  • be careful.
    I have the impression that if you cut and paste from the web page some tabs & extra chars creep in.

    use jshint http://jshint.com/ to validate the file



  • what is the message? invalid configuration… bla bla?



  • Yes! when I start the mirror I get the page “configure.js”

    can you help me to get paste in the right module code?



  • Paste in the jshint site. It will give you the exact line where an error is and what is expected.
    90pc of the time it is correct.

    Other method: remove completely the section, paste it in a text only editor like text pad and the paste it back.

    The rules for json are simple but it can get complicated with indents and nesting