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!

  • MagicMirror Creator

    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

Looks like your connection to MagicMirror Forum was lost, please wait while we try to reconnect.