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

Access the default values in outside functions

  • I’m having troubles accessing my default values in my hello function, in my start function the values exist but in hello they are undefined and unreadable, code is below:

    Module.register("jarvis", {
    // Module defaults
      defaults: {
        assistantName: "jarvis",
        assistantVoice: "UK English Male"
      // Required Scripts
      getScripts: function() {
    	return ["annyang.js",
    hello: function(name) {
          name = name.trim().toLowerCase();
    if(name && (name == this.config.assistantName))
      responsiveVoice.speak("Hello George");
    else {
      start: function() {"Starting module: " +;
        if (annyang) {
          // Let's define a command.
          var commands = {
            'hello (*name)': this.hello
          // Add our commands to annyang
          // Start listening.
    // Setting voice default

    Please help, thank you!

  • Admin

    That’s because “this” is no longer referring to your instance. It’s a common javascript pitfall. Check out:

  • @MichMich Oh okay, thanks for the help!

Log in to reply