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

config,js beginner



  • @berne on 101 u have ] and then on 102 u have another ]

    use a good editor Notepad++ on windows… it will show you the matching ( { and [ with ], } and )


  • Module Developer

    @berne

    • Expected '}' to match '{' from line 90 and instead saw ']'.
      • Remove the ] in the line above (Line 101) This will validate your config you can ignore the other warnings.


  • @sdetweil but can i trust https://jshint.com/
    and do what it saying to get it right, like 102
    just swap ] to }’ on 102

    i what to learn… but is really hard, i Appreciate you time and @idoodler too


  • Module Developer

    @berne I recomend you to to checkout the structure of the existing config.js file.

    You may also check out the W3Schools documentation: https://www.w3schools.com/js/js_objects.asp


  • Project Sponsor

    @berne Can you paste your config.js? We can then have a look to see if it is correct and point to where you may have to make the changes.

    As @sdetweil pointed out, a good text editor like notepad++ would show you the matching “{” and “}” etc.



  • @berne

    I wrote a small post on this topic.
    JSON is supposed to be easy and straightforward, but when there is nested data it can get quite complex.

    https://forum.magicmirror.builders/topic/9712/cannot-add-modules/14



  • @evroom and each module gets to customize the config to their needs, so no two look alike… (to the beginners)



  • I am thinking about install this
    https://github.com/dolanmiu/MMM-awesome-alexa/blob/master/README.md

    But I don’t have a pi button, do I really need that?
    Can’t I jut lay say -Alexa light the magic mirror



  • @mumblebaj
    This is my config now, is it looking right? i havet dare to past in to the config,js berfore some one can tell me its right

    /* Magic Mirror Config Sample
     *
     * By Michael Teeuw http://michaelteeuw.nl
     * MIT Licensed.
     *
     * For more information how you can configurate this file
     * See https://github.com/MichMich/MagicMirror#configuration
     *
     */
    
    var config = {
    	address: "localhost", // Address to listen on, can be:
    	                      // - "localhost", "127.0.0.1", "::1" to listen on loopback interface
    	                      // - another specific IPv4/6 to listen on a specific interface
    	                      // - "", "0.0.0.0", "::" to listen on any interface
    	                      // Default, when address config is left out, is "localhost"
    	port: 8080,
    	ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses
    	                                                       // or add a specific IPv4 of 192.168.1.5 :
    	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
    	                                                       // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
    	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],
    
    	language: "en",
    	timeFormat: 24,
    	units: "metric",
    
    	modules: [
    		{
    			module: "alert",
    		},
    		{
    	           module: "MMM-NowPlayingOnSpotify",
    			position: "bottom_right",
    			config: {
    				showCoverArt: true,
                    		clientID: "XXXXXXXX",
    				clientSecret: "XXXXXXXX",
    				accessToken: "XXXXXXXXX",
    				refreshToken: "XXXXXXXX"
    				}
    		},
    		{
    			  module: 'MMM-awesome-alexa',
    			position: 'bottom_bar',
    			config: {
    			  wakeWord: 'Smart Mirror',
    			        clientId: 'XXXXXXX',
    			    clientSecret: 'XXXXXX',
    			    deviceId: 'Magic_Mirror',
    			    refreshToken: 'XXXXXXX',
    			    lite: false,
    			    isSpeechVisualizationEnabled: true
    			}
    		  }
    		  
    		{
    
    		module: "updatenotification",
    			position: "top_bar"
    		},
    		{
    			module: "clock",
    			position: "top_left"
    		},
    		{
    			module: "calendar",
    			header: "Kalender",
    			position: "top_left",
    			config: {
    				calendars: [
    					{
    						symbol: "calendar-check",
    						url: "https://calendar.google.com/calendar/ical/berntsson88%40gmail.com/public/basic.ics"					}
    				]
    			}
    		},
    		{
    			module: "compliments",
    			position: "lower_third"
    		},
    		{
    			module: "currentweather",
    			position: "top_right",
    			config: {
    				location: "Vara,Sweden",
    				locationID: "2665018",  //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
    				appid: "cb3ba3fb9618b6f6de3fbbb9ee78284e"
    			}
    		},
    		{
    			module: "weatherforecast",
    			position: "top_right",
    			header: "Weather Forecast",
    			config: {
    				location: "Vara,Sweden",
    				locationID: "5128581",  //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
    				appid: "cb3ba3fb9618b6f6de3fbbb9ee78284e"
    			}
    		},
    		{
    			module: "newsfeed",
    			position: "bottom_bar",
    			config: {
    				feeds: [
    				{
    						title: "Aftonbladet",
    						url: "http://www.aftonbladet.se/nyheter/rss.xml"
                                    },
                                    {
    					        title: "Macworld",
                                                    url: "http://feeds.idg.se/idg/FPjt",
                                    },
    	
                                   
    				],
    				showSourceTitle: true,
    				showPublishDate: true,
    				broadcastNewsFeeds: true,
    				broadcastNewsUpdates: true
    			}
    		},
    	]
    
    };
    
    /*************** DO NOT EDIT THE LINE BELOW ***************/
    if (typeof module !== "undefined") {module.exports = config;}

  • Project Sponsor

    @berne You are missing a comma after the closing bracket of MMM-awesome-alexa. It should be },