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

Adding Modules



  • Hello
    I am trying to add MMM-My Standings modules to my magic mirror. I have the default config running fine, but when i add this module it breaks the config

    modules: [
      {
    		module: "MMM-MyStandings",
    		position: "bottom_left",
    		config: {
    			updateInterval: 60 * 60 * 1000, // every 60 minutes
    			rotateInterval: 1 * 60 * 1000, // every 1 minute
    			sports: [
    				{ league: "NBA", groups: ["Atlantic", "Central", "Southeast", "Northwest", "Pacific", "Southwest"] },
    				{ league: "MLB", groups: ["American League East", "American League Central", "American League West", "National League East", "National League Central", "National League West"] },
    				{ league: "NFL", groups: ["AFC East", "AFC North", "AFC South", "AFC West", "NFC East", "NFC North", "NFC South", "NFC West"] },
    				{ league: "NHL", groups: ["Atlantic Division", "Metropolitan Division", "Central Division", "Pacific Division"] },
    				{ league: "MLS", groups: ["Eastern Conference", "Western Conference"] },
    				{ league: "NCAAF", groups: ["American Athletic - East", "American Athletic - West", "Atlantic Coast Conference - Atlantic", "Atlantic Coast Conference - Coastal",
    										"Big 12 Conference", "Big Ten - East", "Big Ten - West", "Conference USA - East", "Conference USA - West",
    										"FBS Independents", "Mid-American - East", "Mid-American - West", "Mountain West - Mountain", "Mountain West - West",
    										"Pac 12 - North", "Pac 12 - South", "SEC - East", "SEC - West", "Sun Belt - East", "Sun Belt - West"] }
    				{ league: "NCAAM", groups: ["America East Conference", "American Athletic Conference", "Atlantic 10 Conference", "Atlantic Coast Conference", "Atlantic Sun Conference",
    										"Big 12 Conference", "Big East Conference", "Big Sky Conference", "Big South Conference",
    										"Big Ten Conference", "Big West Conference", "Colonial Athletic Association", "Conference USA",
    										"Horizon League", "Ivy League", "Metro Atlantic Athletic Conference", "Mid-American Conference",
    										"Mid-Eastern Athletic Conference", "Missouri Valley Conference", "Mountain West Conference", "Northeast Conference",
    										"Ohio Valley Conference", "Pac-12 Conference", "Patriot League", "Southeastern Conference",
    										"Southern Conference", "Southland Conference", "Southwestern Athletic Conference", "Summit League",
    										"Sun Belt Conference", "West Coast Conference", "Western Athletic Conference"] }
    			],
    			nameStyle: "short",
    			showLogos: true,
    			useLocalLogos: true,
    			showByDivision: true,
    			fadeSpeed: 2000,
    		}
      }
    ][
    		{
    			module: "alert",
    		},
    		{
    			module: "updatenotification",
    			position: "top_bar"
    		},
    		{
    			module: "clock",
    			position: "top_left"
    


  • @bkcarroll1 run

    npm run config:check
    

    from the MagicMirror folder

    the error is usually on the line before the problem reported



  • @bkcarroll1 also see the How to add modules link in my signature.

    each { has a }
    each [ has a ]
    sections continued have a trailing ,

    general rules.
    thing on the left of : does NOT need quotes
    if the thing on the right of : is a number or true/false, quotes not used
    otherwise it needs quotes. either kind is ok, long as the are the same for the thing being quoted


  • Project Sponsor Module Developer

    @sdetweil said in Adding Modules:

    also see the How to add modules link in my signature.

    Brilliant! 🙂



  • @sdetweil I have zero clue what I’m doing. I think -{- this is whats causing the issue. I dont know what to do with it though

    pi@raspberrypi:~ $ cd ~/Magic Mirror
    bash: cd: too many arguments
    pi@raspberrypi:~ $ cd ~ /MagicMirror
    bash: cd: too many arguments
    pi@raspberrypi:~ $ cd ~/MagicMirror
    pi@raspberrypi:~/MagicMirror $ npm run config:check
    
    > magicmirror@2.13.0 config:check /home/pi/MagicMirror
    > node js/check_config.js
    
    [2020-10-13 14:31:52.815] [INFO]   Checking file...  /home/pi/MagicMirror/config/config.js
    [2020-10-13 14:31:53.114] [ERROR]  Your configuration file contains syntax errors :(
    [2020-10-13 14:31:53.120] [ERROR]  Line 120 col 5 Parsing error: Unexpected token {
    pi@raspberrypi:~/MagicMirror $ 
    
    modules: [
    		{
    			module: "alert",
    		},
    		{
    			module: "updatenotification",
    			position: "top_bar"
    		},
    		{
    			module: "clock",
    			position: "top_left"
    		},
    		{
    			module: "calendar",
    			header: "Calendar",
    			position: "upper_third",
    			config: {
    				calendars: [
    					{
    						symbol: "My Calendar",
    						url: "https://calendar.google.com/calendar/ical/sucmeup%40gmail.com/public/basic.ics"					}
    				]
    			}
    		},
    		{
    			module: "compliments",
    			position: "lower_third"
    		},
    		{
    			module: "currentweather",
    			position: "top_right",
    			config: {
    				location: "Conroe",
    				locationID: "4682991", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
    				appid: "3aa7f394b0c7484a03d49ef6f9e85a48"
    			}
    		},
    		{
    			module: "weatherforecast",
    			position: "bottom_right",
    			header: "Weather Forecast",
    			config: {
    				location: "Conroe",
    				locationID: "4682991", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
    				appid: "3aa7f394b0c7484a03d49ef6f9e85a48"
    			}
    		},
    		{
    			module: "newsfeed",
    			position: "bottom_bar",
    			config: {
    				feeds: [
    					{
    						title: "New York Times",
    						url: "https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml"
    					}
    				],
    				showSourceTitle: true,
    				showPublishDate: true,
    				broadcastNewsFeeds: true,
    				broadcastNewsUpdates: true
    			}
    		},
    	[
      {
    		module: "MMM-MyStandings",
    		position: "top_right",
    		config: {
    			updateInterval: 60 * 60 * 1000, // every 60 minutes
    			rotateInterval: 1 * 60 * 1000, // every 1 minute
    			sports: [
    				{ league: "NBA", groups: ["Atlantic", "Central", "Southeast", "Northwest", "Pacific", "Southwest"] },
    				{ league: "MLB", groups: ["American League East", "American League Central", "American League West", "National League East", "National League Central", "National League West"] },
    				{ league: "NFL", groups: ["AFC East", "AFC North", "AFC South", "AFC West", "NFC East", "NFC North", "NFC South", "NFC West"] },
    				{ league: "NHL", groups: ["Atlantic Division", "Metropolitan Division", "Central Division", "Pacific Division"] },
    				{ league: "MLS", groups: ["Eastern Conference", "Western Conference"] },
    				{ league: "NCAAF", groups: ["American Athletic - East", "American Athletic - West", "Atlantic Coast Conference - Atlantic", "Atlantic Coast Conference - Coastal",
    										"Big 12 Conference", "Big Ten - East", "Big Ten - West", "Conference USA - East", "Conference USA - West",
    										"FBS Independents", "Mid-American - East", "Mid-American - West", "Mountain West - Mountain", "Mountain West - West",
    										"Pac 12 - North", "Pac 12 - South", "SEC - East", "SEC - West", "Sun Belt - East", "Sun Belt - West"] }
    				{ league: "NCAAM", groups: ["America East Conference", "American Athletic Conference", "Atlantic 10 Conference", "Atlantic Coast Conference", "Atlantic Sun Conference",
    										"Big 12 Conference", "Big East Conference", "Big Sky Conference", "Big South Conference",
    										"Big Ten Conference", "Big West Conference", "Colonial Athletic Association", "Conference USA",
    										"Horizon League", "Ivy League", "Metro Atlantic Athletic Conference", "Mid-American Conference",
    										"Mid-Eastern Athletic Conference", "Missouri Valley Conference", "Mountain West Conference", "Northeast Conference",
    										"Ohio Valley Conference", "Pac-12 Conference", "Patriot League", "Southeastern Conference",
    										"Southern Conference", "Southland Conference", "Southwestern Athletic Conference", "Summit League",
    										"Sun Belt Conference", "West Coast Conference", "Western Athletic Conference"] }
    			],
    			nameStyle: "short",
    			showLogos: true,
    			useLocalLogos: true,
    			showByDivision: true,
    			fadeSpeed: 2000,
    		}
      }
    ]
    ]
    };
    


  • @bkcarroll1 as I said, the error is usually on the line before the one reported

    missing comma

    when u see
    “unexpected token”
    99% of the time there is a missing trailing comma on the line before



  • @sdetweil I just tried to do your Jeopardy tutorial and i got it working. Your tutorial was missing the line for animationSpeed. After adding that line it worked. I cant copy and paste. My format changes when I do and thats whats breaking the config. If i manually type the lines it works perfectly. Just wanted to make something for the wife. Thanks for help.



  • @bkcarroll1 jeopardy tutorial?

    animationspeed??



  • @sdetweil My mistake is was a post with a tutorial from @Mykle1



  • @bkcarroll1 I just reference it Everytime someone new comes along.


Log in to reply