<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Collaboration of MMM-ProfileSwitcher and MMM-pages modules]]></title><description><![CDATA[<p dir="auto">Please help me to get torn using MMM-ProfileSwitcher and MMM-pages modules</p>
<p dir="auto">I have multiple calendars and I want to display them separately on my page. To do this, I want to get the current page number from MMM-pages and use it as ‘classes:’ in the ProfileSwitcher.</p>
<p dir="auto">Here is what my config file looks like.</p>
<pre><code>let config = {
	address: "0.0.0.0", 	// Address to listen on, can be:
	port: 8080,
	basePath: "/", 	
	ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1", "192.168.1.0/24"],
	useHttps: false, 		
	httpsPrivateKey: "", 	
	httpsCertificate: "", 

	logLevel: ["INFO", "LOG", "WARN", "ERROR"], 
	timeFormat: 24,
	units: "metric",
	modules: [
//------------------------MMM-WatchDog----------------------------------------
		{
			module: 'MMM-WatchDog',
			config: {
				interval: 10,
				timeout: 15,
				// See 'Configuration options' for more information.
			}
		},
//---------------------------MMM-pages--------------------------------------
		{
	        module: 'MMM-pages',
	        config: {
	        		modules:
	                	[["alert", "clock", "updatenotification", "calendar"],
	                	 ["calendar"]],
					rotationTime: 15000, 
					delayTime: 15000, 
// !!!	        		  Action: [
//!!!!	        		sendNotification("CURRENT_PROFILE", "1"),
//!!!!        		notification:'CURRENT_PROFILE', payload: this.NEW_PAGE,
	        		// ]
	        		},
		},
//-------------------MMM-ProfileSwitcher ----------------------------
    {
        module: 'MMM-ProfileSwitcher',
        config: {
            // See 'Configuration options' for more information.
        },
    },
//-------------------MMM-page-indicator Page0 -------------------------
		{
	        module: 'MMM-page-indicator',
	        classes: 'default everyone', 
	        position: 'bottom_bar',
	        config: {
	            pages: 2,
//!!!!	            notification:'CURRENT_PROFILE', payload: NEW_PAGE,
//!!!!!	          Action: [
//!!!!!			{notification:'CURRENT_PROFILE',payload: this.NEW_PAGE},
//!!!!!				],
			},	
		},
//------------
		{
			module: "alert",
//			classes: 'default everyone', 
			config: {
				position: "center",
				display_time: 4500,
		},
		{
			module: "clock",
			classes: 'default everyone', 
			position: "top_left"
		},
//------------------calendar Page1 ---------
{
		module: "calendar",
		classes: 1, 
		header: "Alex",
		position: "top_right",
			config: {
				displaySymbol: true,
				maximumEntries: 12,
				maximumNumberOfDays: 4,
				coloredSymbolOnly: true,
				calendars: [
					{
						name: "Alex",
						displaySymbol: true,
						symbol: 'user-secret',
						url: "-------",
//						maximumNumberOfDays: 1,
						fade: false,
						showEnd: true,
						auth: {
							user: '-----',
							pass: '-------',
							method: 'basic',
						}	
					},
{
		module: "calendar",
		classes: '2',
		header: "Den",
		position: "top_right",
			config: {
				displaySymbol: true,
				maximumEntries: 12,
				maximumNumberOfDays: 4,
				coloredSymbolOnly: true,
				calendars: [
					{
						name: "Den",
						symbol: 'user-astronaut',
						url: "--------",
//						maximumNumberOfDays: 1,
						fade: false,
						showEnd: true,
						auth: {
							user: '----------',
							pass: '---------',
							method: 'basic',
						}	
					},	
				],
			},
},
]
</code></pre>
<p dir="auto">But I don’t know how should I write this.sendNotification(‘CURRENT_PROFILE’, ‘DESIRED_PROFILE_NAME_HERE’);</p>
<p dir="auto">Please help me figure it out. If possible, an example config file. And then I’ll figure it out myself.</p>
<p dir="auto">I will be very grateful for any help.<br />
Thanks in advance!</p>
]]></description><link>https://forum.magicmirror.builders/topic/17238/collaboration-of-mmm-profileswitcher-and-mmm-pages-modules</link><generator>RSS for Node</generator><lastBuildDate>Mon, 11 May 2026 11:15:25 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/17238.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 28 Sep 2022 19:56:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Collaboration of MMM-ProfileSwitcher and MMM-pages modules on Wed, 28 Sep 2022 21:22:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kostosso" aria-label="Profile: Kostosso">@<bdi>Kostosso</bdi></a></p>
<p dir="auto">you won’t find this documented anywhere, its just my idea of making it all better</p>
<p dir="auto">i took the sample config  (config.js.sample)</p>
<p dir="auto">and added mmm-pages</p>
<p dir="auto">and used the sample mm-pages config (its only for a few  modules)  (from the <a href="http://readme.md" target="_blank" rel="noopener noreferrer nofollow ugc">readme.md</a>)</p>
<p dir="auto">mmm-pages added at the end…<br />
only classes: added for the pages defined</p>
<pre><code>
    modules: [
        {
            module: "alert",
        },
        {
            module: "updatenotification",
            position: "top_bar"
        },
        {
            module: "clock",
            position: "top_left"
        },
        {
            module: "calendar",
            header: "US Holidays",
            position: "top_left",
            classes:"page2"
            config: {
                calendars: [
                    {
                        symbol: "calendar-check",
                        url: "webcal://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics"
                    }
                ]
            }
        },
        {
            module: "compliments",
            position: "lower_third",
            classes:"page2"
        },
        {
            module: "weather",
            position: "top_right",
            config: {
                weatherProvider: "openweathermap",
                type: "current",
                location: "New York",
                locationID: "5128581", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
                apiKey: "YOUR_OPENWEATHER_API_KEY"
            }
        },
        {
            module: "weather",
            position: "top_right",
            header: "Weather Forecast",
            config: {
                weatherProvider: "openweathermap",
                type: "forecast",
                location: "New York",
                locationID: "5128581", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
                apiKey: "YOUR_OPENWEATHER_API_KEY"
            }
        },
        {
            module: "newsfeed",
            position: "bottom_bar",
            classes:"page1",
            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-pages',
            config: {
                    modules:
                        [
                         [ "page1"],
                         [ "page2"]
                        ],
                    fixed: [ "clock", "weather", "MMM-page-indicator" ], // could have used 'fixed' as a classname here and add that to fixed modules
                    hiddenPages: {      // same here screensaver and admin classes
                        "screenSaver": [ "clock", "MMM-SomeBackgroundImageModule" ],
                        "admin": [ "MMM-ShowMeSystemStatsModule", "MMM-AnOnScreenMenuModule" ],
                    },
            }
        }
   ]
};
</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/104798</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/104798</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Wed, 28 Sep 2022 21:22:46 GMT</pubDate></item><item><title><![CDATA[Reply to Collaboration of MMM-ProfileSwitcher and MMM-pages modules on Wed, 28 Sep 2022 21:23:17 GMT]]></title><description><![CDATA[<p dir="auto">:thumbs_up: Super! Issue closed!</p>
<p dir="auto">THANK YOU SO MUCH!:handshake:</p>
]]></description><link>https://forum.magicmirror.builders/post/104799</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/104799</guid><dc:creator><![CDATA[Kostosso]]></dc:creator><pubDate>Wed, 28 Sep 2022 21:23:17 GMT</pubDate></item><item><title><![CDATA[Reply to Collaboration of MMM-ProfileSwitcher and MMM-pages modules on Wed, 28 Sep 2022 21:22:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kostosso" aria-label="Profile: Kostosso">@<bdi>Kostosso</bdi></a></p>
<p dir="auto">you won’t find this documented anywhere, its just my idea of making it all better</p>
<p dir="auto">i took the sample config  (config.js.sample)</p>
<p dir="auto">and added mmm-pages</p>
<p dir="auto">and used the sample mm-pages config (its only for a few  modules)  (from the <a href="http://readme.md" target="_blank" rel="noopener noreferrer nofollow ugc">readme.md</a>)</p>
<p dir="auto">mmm-pages added at the end…<br />
only classes: added for the pages defined</p>
<pre><code>
    modules: [
        {
            module: "alert",
        },
        {
            module: "updatenotification",
            position: "top_bar"
        },
        {
            module: "clock",
            position: "top_left"
        },
        {
            module: "calendar",
            header: "US Holidays",
            position: "top_left",
            classes:"page2"
            config: {
                calendars: [
                    {
                        symbol: "calendar-check",
                        url: "webcal://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics"
                    }
                ]
            }
        },
        {
            module: "compliments",
            position: "lower_third",
            classes:"page2"
        },
        {
            module: "weather",
            position: "top_right",
            config: {
                weatherProvider: "openweathermap",
                type: "current",
                location: "New York",
                locationID: "5128581", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
                apiKey: "YOUR_OPENWEATHER_API_KEY"
            }
        },
        {
            module: "weather",
            position: "top_right",
            header: "Weather Forecast",
            config: {
                weatherProvider: "openweathermap",
                type: "forecast",
                location: "New York",
                locationID: "5128581", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
                apiKey: "YOUR_OPENWEATHER_API_KEY"
            }
        },
        {
            module: "newsfeed",
            position: "bottom_bar",
            classes:"page1",
            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-pages',
            config: {
                    modules:
                        [
                         [ "page1"],
                         [ "page2"]
                        ],
                    fixed: [ "clock", "weather", "MMM-page-indicator" ], // could have used 'fixed' as a classname here and add that to fixed modules
                    hiddenPages: {      // same here screensaver and admin classes
                        "screenSaver": [ "clock", "MMM-SomeBackgroundImageModule" ],
                        "admin": [ "MMM-ShowMeSystemStatsModule", "MMM-AnOnScreenMenuModule" ],
                    },
            }
        }
   ]
};
</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/104798</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/104798</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Wed, 28 Sep 2022 21:22:46 GMT</pubDate></item><item><title><![CDATA[Reply to Collaboration of MMM-ProfileSwitcher and MMM-pages modules on Wed, 28 Sep 2022 20:57:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a><br />
How and where to use classes: I understood in modules.</p>
<p dir="auto">I read a lot of articles in the forum, but never our sample structure</p>
<p dir="auto">modules:[<br />
[ ‘page1’ ],<br />
[‘page2’]<br />
]<br />
And how to apply it in practice, I did not find.</p>
<p dir="auto">Maybe there is a piece of the config file where it can be seen in detail (example).</p>
<p dir="auto">:folded_hands: Thanks again for your help.</p>
]]></description><link>https://forum.magicmirror.builders/post/104797</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/104797</guid><dc:creator><![CDATA[Kostosso]]></dc:creator><pubDate>Wed, 28 Sep 2022 20:57:52 GMT</pubDate></item><item><title><![CDATA[Reply to Collaboration of MMM-ProfileSwitcher and MMM-pages modules on Wed, 28 Sep 2022 20:36:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kostosso" aria-label="Profile: Kostosso">@<bdi>Kostosso</bdi></a></p>
<p dir="auto">setup your pages config as I had shown</p>
<p dir="auto">only one classname in each ‘page’ definition, ‘page1’,‘page2’, etc</p>
<p dir="auto">then go to a module  definition</p>
<p dir="auto">calendar</p>
<p dir="auto">what pages do you want THIS instance to appear on</p>
<p dir="auto">add those ‘page’ names to the classes list</p>
<p dir="auto">repeat thru all the modules in config.</p>
<p dir="auto">now profile is a DIFFERENT way of selecting modules</p>
<p dir="auto">they take some logical profile name</p>
<p dir="auto">by person<br />
SAM<br />
MARY<br />
SUE<br />
TOM</p>
<p dir="auto">so you would add THOSE profile name(maybe more than 1) to the modules you want shown of THAT person (or more)</p>
<p dir="auto">suppose u want the family calendar to be shown for both mom and dad  and they have profile names that way<br />
you would add “mom dad” to the classes list for that calendar entry, but not for the kids profiles</p>
<p dir="auto">and then u would tell profile switch (via the notification), which PROFILE name to show modules for…</p>
<p dir="auto">MagicMirror can only show or hide modules… everything in config.js  is loaded EVERY time it starts up.</p>
]]></description><link>https://forum.magicmirror.builders/post/104796</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/104796</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Wed, 28 Sep 2022 20:36:24 GMT</pubDate></item><item><title><![CDATA[Reply to Collaboration of MMM-ProfileSwitcher and MMM-pages modules on Wed, 28 Sep 2022 20:28:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kostosso" aria-label="Profile: Kostosso">@<bdi>Kostosso</bdi></a> i posted it</p>
<p dir="auto">pages has a config option</p>
<pre><code class="language-text">    modules: [
    ]
</code></pre>
<p dir="auto">which has the list of page configurations</p>
]]></description><link>https://forum.magicmirror.builders/post/104795</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/104795</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Wed, 28 Sep 2022 20:28:58 GMT</pubDate></item><item><title><![CDATA[Reply to Collaboration of MMM-ProfileSwitcher and MMM-pages modules on Wed, 28 Sep 2022 20:24:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a><br />
Thank you so much, but I didn’t fully understand where I need to specify</p>
<pre><code>['page1']
['page2']


['pagen'] 
</code></pre>
<p dir="auto">and how do I link this definition to MMM-pages modules?</p>
<p dir="auto">I realized that I define classes in the header of each module</p>
<pre><code>module:'MMM-page-indicator',
        classes: 'default everyone',
</code></pre>
<p dir="auto">Can you elaborate a little more on this or a link where you can read it.</p>
]]></description><link>https://forum.magicmirror.builders/post/104794</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/104794</guid><dc:creator><![CDATA[Kostosso]]></dc:creator><pubDate>Wed, 28 Sep 2022 20:24:49 GMT</pubDate></item><item><title><![CDATA[Reply to Collaboration of MMM-ProfileSwitcher and MMM-pages modules on Wed, 28 Sep 2022 20:14:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kostosso" aria-label="Profile: Kostosso">@<bdi>Kostosso</bdi></a> said in <a href="/post/104787">Collaboration of MMM-ProfileSwitcher and MMM-pages modules</a>:</p>
<blockquote>
<p dir="auto">But I don’t know how should I write this.sendNotification(‘CURRENT_PROFILE’, ‘DESIRED_PROFILE_NAME_HERE’);</p>
</blockquote>
<p dir="auto">now… that needs to be sent by SOME other module…</p>
<p dir="auto">most of those other modules have some kind of config</p>
<p dir="auto">remote_control<br />
alexaControl<br />
facereco_dnn (altho it uses classes directly like pages, so you wouldn’t need profile switcher)…</p>
<p dir="auto">where u can put the notification string ‘CURRENT_PROFILE’<br />
and whatever data (aka payload)  that notification expects…</p>
<p dir="auto">now you can ALSO add  other classes that can make profile switching easier…</p>
<p dir="auto">for me add SAM to the list of classes<br />
then show modules with classes containing SAM</p>
<p dir="auto">that is what the profile module does…</p>
<p dir="auto">so, in remote_control is would be  ‘CURRENT_PROFILE’,'SAM"</p>
]]></description><link>https://forum.magicmirror.builders/post/104789</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/104789</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Wed, 28 Sep 2022 20:14:55 GMT</pubDate></item><item><title><![CDATA[Reply to Collaboration of MMM-ProfileSwitcher and MMM-pages modules on Wed, 28 Sep 2022 20:07:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kostosso" aria-label="Profile: Kostosso">@<bdi>Kostosso</bdi></a> so, before I get to switcher, etc</p>
<p dir="auto">change your model for pages</p>
<p dir="auto">pages uses the CLASSES of the modules.<br />
either the module name class, or those assigned in the classes: property</p>
<p dir="auto">for me the most logical thing is the declare in pages</p>
<pre><code>    modules [
                             ["page1"],
                             ["page2"],
                              ...
                             ["pagen"]
      ]
</code></pre>
<p dir="auto">for each of the ‘pages’ (module groupings)  you want to display</p>
<p dir="auto">THEN at each module, in the classes: property<br />
set the pages u want that module to show on</p>
<p dir="auto">so, for only page1</p>
<pre><code>      classes:"page1"
</code></pre>
<p dir="auto">for pages 1 and 3</p>
<pre><code>      classes:"page1 page3"
</code></pre>
<p dir="auto">then you configure at the module</p>
<p dir="auto">now, that also fixes the  problem of multiple instances, cause you assign the instance to the page u want it on…</p>
]]></description><link>https://forum.magicmirror.builders/post/104788</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/104788</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Wed, 28 Sep 2022 20:07:58 GMT</pubDate></item></channel></rss>