<?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[MMM-Pages - Turn scripts on&#x2F;off when enter page]]></title><description><![CDATA[<p dir="auto">Hi all,</p>
<p dir="auto">Is it possible to start a script (Python or bash) when a specific page is entered? I use MM-Pages with a webradio on the third page. The idea is to start the webradio (mpc) combined with a script to get the lyrics of the currently played song (already developed) in case, page 3 is called. I don’t want to stress the lyrics-search if the affected page is not shown. So it would be nice have a trigger  and to be able to start something on the PI.</p>
<p dir="auto">Thank you in advance<br />
Thomas</p>
]]></description><link>https://forum.magicmirror.builders/topic/13055/mmm-pages-turn-scripts-on-off-when-enter-page</link><generator>RSS for Node</generator><lastBuildDate>Wed, 13 May 2026 14:07:57 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/13055.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 12 Jun 2020 12:09:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MMM-Pages - Turn scripts on&#x2F;off when enter page on Fri, 12 Jun 2020 14:54:35 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/rubenix" aria-label="Profile: rubenix">@<bdi>rubenix</bdi></a> ,</p>
<p dir="auto">Thank you for your hint, I will give it a try.</p>
<p dir="auto">Greetings<br />
Thomas</p>
]]></description><link>https://forum.magicmirror.builders/post/76956</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/76956</guid><dc:creator><![CDATA[thgmirror]]></dc:creator><pubDate>Fri, 12 Jun 2020 14:54:35 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-Pages - Turn scripts on&#x2F;off when enter page on Fri, 12 Jun 2020 14:51:54 GMT]]></title><description><![CDATA[<p dir="auto">Take a look at MMM-NotificationTrigger module; Im using it for a lot of things; you can trigger any shell command when something happens (ie. When entering to page x)</p>
<p dir="auto">here just an example:</p>
<pre><code>        {
            module: 'MMM-NotificationTrigger',
            config: {
                useWebhook: false,
                triggers: [
                    {
                        trigger: "NEW_PAGE",
                        triggerPayloadFilter: (payload) =&gt; {
                            if (payload == '0') return true		//when entering page 1
                            return false
                        },
                        fires: [
                            { exec: "aplay /home/pi/somefile.wav" },
                            { fire: "MY_COMMAND", exec: "curl 'http://RaspHostname:8080/api//modules/MMM-Whatever/show'" },
                            { fire: "MY_COMMAND", exec: "curl 'http://RaspHostname::8080/api//modules/MMM-Whatever/hide'" },
                            { fire: "WHATEVER_NOTIFICATION },
                           { fire: "MY_COMMAND", exec: "/home/pi/somescript.sh" },
                        ],
                    },
...
...
</code></pre>
<p dir="auto">I consider this a MUST in any Magic Mirror setup…<br />
Can do anything you want with it :winking_face:</p>
]]></description><link>https://forum.magicmirror.builders/post/76955</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/76955</guid><dc:creator><![CDATA[rubenix]]></dc:creator><pubDate>Fri, 12 Jun 2020 14:51:54 GMT</pubDate></item></channel></rss>