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

Modules not appearing in pages

Open KrypticCoconut opened this issue 4 years ago • 1 comments

hello there, im experiencing a problem where the modules wouldn't appear on the pages here's my config: https://pastebin.com/Cc0qdcWU I was testing if this works by assigning the weatherforecast module to my default page which is "weather", and it did not appear. Can someone help me?

also I am going to use voice commands using a recipe I will make for MMM-Google assistant

KrypticCoconut avatar Aug 07 '20 02:08 KrypticCoconut

Hey, I see a couple of problems that will be causing your issue.

  1. The prop to set which pages modules appear on is pages, not page
  2. If you are using this module, you stop using position and start using pages. If something just has a position set but not pages then it will not appear. If you want to have a module appear on all pages, then you would use pages: {"all": "YOUR_POSITION"}

Here is a config I would suggest using:

var config = {
	address: "localhost", // Address to listen on, can be:
	electronOptions: {
		webPreferences: {
			webviewTag: true
		}
	},
	// - "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: 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"],

	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: "en",
	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",
			pages: {"all": "top_center"},
			config: {
				defaultPage: "weather",
				displayTitle: true,
				selectPageNotif: ["SELECT_PAGE"],
				incrementPageNotif: ["PAGE_UP"],
				decrementPageNotif: ["PAGE_DOWN"],
				autoChange: {
					interval: 20
				}
			}
		},
		{
			module: "MMM-Assistant2Display",
			pages: {"all": "top_left"},
			config: {
				debug: false,
				useYoutube: false,
				links: {
					useLinks: true,
					displayDelay: 40 * 1000,
					scrollStep: 200,
					scrollInterval: 1000,
					scrollStart: 20000,
					scrollActivate: true,
					verbose: false
				},
				photos: {
					usePhotos: true,
					displayDelay: 10 * 1000
				},
				volume: {
					useVolume: true,
					volumePreset: "ALSA"
				},
				briefToday: {
					useBriefToday: false,
					welcome: "brief Today"
				},
				screen: {
					useScreen: false,
					delay: 5 * 60 * 1000,
					turnOffDisplay: true,
					ecoMode: true,
					displayCounter: true,
					text: "Auto Turn Off Screen:",
					detectorSleeping: false,
					governorSleeping: false,
					rpi4: false
				},
				pir: {
					usePir: false,
					gpio: 21,
					reverseValue: false
				},
				governor: {
					useGovernor: false,
					sleeping: "powersave",
					working: "ondemand"
				},
				internet: {
					useInternet: false,
					displayPing: false,
					delay: 2 * 60 * 1000,
					scan: "google.fr",
					command: "pm2 restart 0",
					showAlert: true
				},
				TelegramBot: {
					useTelecastSound: false,
					TelecastSound: "TelegramBot.ogg"
				},
				cast: {
					useCast: false,
					castName: "MagicMirror_A2D",
					port: 8569
				},
				spotify: {
					useSpotify: false,
					connectTo: null,
					playDelay: 3000,
					minVolume: 10,
					maxVolume: 100
				}
			}
		},
		{
			module: "MMM-GoogleAssistant",
			pages: {"all": "fullscreen_above"},
			config: {
				debug: false,
				assistantConfig: {
					lang: "en-US",
					projectId: "", // Required to use gaction.
					modelId: "", // (OPTIONAL for gaction)
					instanceId: "", // (OPTIONAL for gaction)
					latitude: x,
					longitude: x,
				},
				responseConfig: {
					useScreenOutput: true,
					screenOutputCSS: "screen_output.css",
					screenOutputTimer: 5000,
					activateDelay: 500,
					useAudioOutput: true,
					useChime: true
				},
				micConfig: { // put there configuration generated by auto-installer
					recorder: "arecord",
					device: "plughw:2",
				},
				customActionConfig: {
					autoMakeAction: false,
					autoUpdateAction: false, // in RPI, gaction CLI might have some trouble.(current version should be 2.2.4, but for linux-arm, Google haven't updated) so leave this as false in RPI. I don't know it is solved or not.
					actionLocale: "en-US", // At this moment, multi-languages are not supported, sorry. Someday I'll work.
				},
				snowboy: {
					audioGain: 2.0,
					Frontend: true,
					Model: "smart_mirror",
					Sensitivity: 0.7
				},
				A2DServer: {
					useA2D: true,
					stopCommand: "stop"
				},
				//    recipes: [ "Reboot-Restart-Shutdown.js" ]
			}
		},
		{
			disabled: false,
			module: 'MMM-EveryNews',
			pages: {"all": "bottom_right"},
			config: {
				source: 'bbc-news,cbs-news', // any source from https://newsapi.org/sources. // Up to 10 at once
				scroll: true,                                  // description scroll or static
				scrollSpeed: "3",                              // if scroll is true
				apiKey: 'x',    // free API key from https://newsapi.org/register
				useHeader: true,                               // False if you don't want a header
				header: "News!",           // Any text you want. useHeader must be true
				maxWidth: "350px",
				animationSpeed: 3000,                          // fade speed
				rotateInterval: 5 * 60 * 1000,
			}
		},
		{
			disabled: false,
			module: "MMM-AfterShip",
			pages: {"all": "bottom_left"},
			config: {
				apiKey: "x",  // Your free API Key from aftership.com
				apiLanguage: "en",
				useHeader: true,                   // False if you don't want a header
				header: "Aftership Tracking",      // Change in config file. useHeader must be true
				maxWidth: "300px",
				animationSpeed: 3000,              // fade speed
				rotateInterval: 30 * 1000,         // seconds between shipments
				dateTimeFormat: "ddd, MMM DD, YYYY, h:mm a",
				dateFormat: "ddd, MMM DD, YYYY"

			}
		},
		{
			module: "weatherforecast",
			pages: { weather: "bottom_left" },                                                         // Best results in left or right regions.
			config: {
				// See 'Configuration options' for more information.
				location: "x",
				locationID: "x", //Location ID from http://bulk.openweathermap.org/sample/city.list.json.gz
				appid: "x" //openweathermap.org API key.
			}
		},
		{
			module: "currentweather",
			pages: {"all": "top_left"},
			// Best results in left or right regions.
			config: {
				// See 'Configuration options' for more information.
				location: "x",
				locationID: "x", //Location ID from http://bulk.openweathermap.org/sample/city.list.json.gz
				appid: "x" //openweathermap.org API key.
			}
		},
		{
			module: "clock",
			pages: {"all": "top_right"},
			config: {
				// The config property is optional.
				// See 'Configuration options' for more information.
			}
		},
		{
			module: "calendar",
			header: "US Holidays",
			pages: {"all": "top_left"},
			config: {
				calendars: [
					{
						symbol: "calendar-check",
						url: "https://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics"
					}
				]
			}
		},
		{
			module: "newsfeed",
			pages: {"all": "bottom_bar"},
			config: {
				feeds: [
					{
						title: "New York Times",
						url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml"
					}
				],
				showSourceTitle: true,
				showPublishDate: true,
				broadcastNewsFeeds: true,
				broadcastNewsUpdates: true
			}
		},
	]

};

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

This config should work, but it is mostly useless. It defines only one page, weather. Since there is no other page, this is the one that will always appear. If you want to add more pages, change the all prop on some other modules to be some other page name.

Veldrovive avatar Aug 08 '20 19:08 Veldrovive