MMM-Page-Selector icon indicating copy to clipboard operation
MMM-Page-Selector copied to clipboard

The page doesn't change

Open iWennnn opened this issue 4 years ago • 3 comments

Hey everyone ! So I'm trying to get MMM-Page-Selector on my MM, but my problem is that when I launch my MM, it can't load some of the modules from my main page (newsfeed and calendar). An other problem is that when I change the page by clicking on the dots from the page indicator, the white dot changes position but the page doesn't update. I'll send my config file in the next message. Thank you in advance

iWennnn avatar Jul 31 '20 14:07 iWennnn

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 or empty, is "localhost"
	port: "8085",
	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"],

	useHttps: false, 		// Support HTTPS or not, default "false" will use HTTP
	httpsPrivateKey: "", 	// HTTPS private key path, only require when useHttps is true
	httpsCertificate: "", 	// HTTPS Certificate path, only require when useHttps is true

	language: "fr",
	timeFormat: 24,
	units: "metric",
	// serverOnly:  true/false/"local" ,
			     // local for armv6l processors, default
			     //   starts serveronly and then starts chrome browser
			     // false, default for all  NON-armv6l devices
			     // true, force serveronly mode, because you want to.. no UI on this device

	modules: [
	    {
			module: "MMM-Page-Selector",
			// position: "top_center",
			config: {
				defaultPage: "main",
				displayTitle: true,
				selectPageNotif: ["SELECT_PAGE"],
				incrementPageNotif: ["PAGE_UP"],
				decrementPageNotif: ["PAGE_DOWN"],
				persistentPages: true,
				autoChange: {
				interval: 100,
				},
			},
		},
		{
			module: "alert",
            // position: "top_bar",
		},
		{
			module: "updatenotification",
			// position: "top_bar",
		},
		{
			module: "clock",
			// position: "top_left",
		},
	    {
		{
			module: "newsfeed",
			// name: "France Info",
			// position: "bottom_bar",
			config: {
				feeds: [
					{
						title: "France Info",
						url: "https://www.francetvinfo.fr/titres.rss"
					}
				],
				showSourceTitle: true,
				showPublishDate: true,
			}
		},
		{
			module: "calendar",
			//name: "Calendrier Perso",
			// position: "top_left",
			config: {
				calendars: [
					{
						symbol: "Agenda",
						url: "my calendar url",
					},
					{
						symbol: "Perso",
						url: "my calendar url2",
						
					}
				]
			}
		},
		{
			module: "currentweather",
			// position: "top_right",
			config: {
				location: "Bordeaux, France",
                locationID: "3031582",
				appid: "MyAPIKey"
				degreeLabel: "true",
				updateInterval: "1200000",
				// useBeaufort: "false",
				// useKMPHwind: "true"
				
			}
		},
		{
			module: "weatherforecast",
			// position: "top_right",
			config: {
                location: "Bordeaux, France",
				locationID: "3031582",
				appid: "MyAPIKey",
				scale: "true",
				updateInterval: "3600000",
				useBeaufort: "false",
				// maxNumberOfDays : "6"
				// useKMPHwind: "true",
			}
        },
		{
			module: "MMM-page-indicator",
			config: {
				pages: 2,
			}
		},
    ],
	pages: {
		main: {
			"updatenotification": "top_bar",
            "clock": "top_left",
			"newsfeed": "bottom_bar",
			"calendar": "top_left",
			"currentweather": "top_right",
			"weatherforecast": "top_right",
		},
		second: {
			"clock": "top_right",
            "newsfeed": "top_bar",
		},
	},
	exclusions: {
		"MMM-page-indicator": "bottom_bar",
	},

};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {module.exports = config;}

iWennnn avatar Jul 31 '20 14:07 iWennnn

Update: You should pull the newest version. I added a bit more logging so that it's easier to figure out which modules are causing issues and also made it so that modules render in the correct order even when there are exclusions.

Hey, I see a couple of potential problems.

  1. On line 55, right before your newsfeed module, you have an opening bracket without a closing one. You can just remove it.
  2. On line 95, inside your currentweather config, you do not have a comma.
  3. Page Selector must still have a position prop.
  4. This isn't a breaking problem, but MMM-page-indicator does not require a config because this module sets the number of pages automatically.
  5. This doesn't actually matter for magic mirror I do not think, but true JSON does not have trailing commas. So the final element in an array doesn't have a comma after it.

Here is my suggested config. I haven't tested it because magic mirror isn't working on my mac right now for some reason, but it should work.

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 or empty, is "localhost"
  port: "8085",
  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"],

  useHttps: false, // Support HTTPS or not, default "false" will use HTTP
  httpsPrivateKey: "", // HTTPS private key path, only require when useHttps is true
  httpsCertificate: "", // HTTPS Certificate path, only require when useHttps is true

  language: "fr",
  timeFormat: 24,
  units: "metric",
  // serverOnly:  true/false/"local" ,
  // local for armv6l processors, default
  //   starts serveronly and then starts chrome browser
  // false, default for all  NON-armv6l devices
  // true, force serveronly mode, because you want to.. no UI on this device

  modules: [{
      module: "MMM-Page-Selector",
      position: "top_center",
      config: {
        defaultPage: "main",
        displayTitle: true,
        selectPageNotif: ["SELECT_PAGE"],
        incrementPageNotif: ["PAGE_UP"],
        decrementPageNotif: ["PAGE_DOWN"],
        persistentPages: true,
        autoChange: {
          interval: 100,
        },
      },
    },
    {
      module: "alert",
      // position: "top_bar",
    },
    {
      module: "updatenotification",
      // position: "top_bar",
    },
    {
      module: "clock",
      // position: "top_left",
    },
    {
      module: "newsfeed",
      // name: "France Info",
      // position: "bottom_bar",
      config: {
        feeds: [{
          title: "France Info",
          url: "https://www.francetvinfo.fr/titres.rss"
        }],
        showSourceTitle: true,
        showPublishDate: true,
      }
    },
    {
      module: "calendar",
      //name: "Calendrier Perso",
      // position: "top_left",
      config: {
        calendars: [{
            symbol: "Agenda",
            url: "my calendar url",
          },
          {
            symbol: "Perso",
            url: "my calendar url2",

          }
        ]
      }
    },
    {
      module: "currentweather",
      // position: "top_right",
      config: {
        location: "Bordeaux, France",
        locationID: "3031582",
        appid: "MyAPIKey",
        degreeLabel: "true",
        updateInterval: "1200000",
        // useBeaufort: "false",
        // useKMPHwind: "true"

      }
    },
    {
      module: "weatherforecast",
      // position: "top_right",
      config: {
        location: "Bordeaux, France",
        locationID: "3031582",
        appid: "MyAPIKey",
        scale: "true",
        updateInterval: "3600000",
        useBeaufort: "false",
        // maxNumberOfDays : "6"
        // useKMPHwind: "true",
      }
    },
    {
      module: "MMM-page-indicator"
    }
  ],
  pages: {
    main: {
      "updatenotification": "top_bar",
      "clock": "top_left",
      "newsfeed": "bottom_bar",
      "calendar": "top_left",
      "currentweather": "top_right",
      "weatherforecast": "top_right",
    },
    second: {
      "clock": "top_right",
      "newsfeed": "top_bar",
    }
  },
  exclusions: {
    "MMM-page-indicator": "bottom_bar",
  }
};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {
  module.exports = config;
}

Veldrovive avatar Aug 01 '20 22:08 Veldrovive

Thank you for the quick answer ! (Sorry I was on holiday with family) I'll check this as soon as possible !

iWennnn avatar Aug 10 '20 15:08 iWennnn