<?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[PIR Sensor for MMM-ProfileSwitcher]]></title><description><![CDATA[<p dir="auto">Has anybody setup ProfileSwitcher to work with a PIR sensor?<br />
I like the idea of having a photo slideshow as the default profile that switches to a data view upon detecting motion but I haven’t found a way to do this yet.</p>
]]></description><link>https://forum.magicmirror.builders/topic/2376/pir-sensor-for-mmm-profileswitcher</link><generator>RSS for Node</generator><lastBuildDate>Fri, 06 Mar 2026 20:47:36 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/2376.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 21 Apr 2017 17:41:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to PIR Sensor for MMM-ProfileSwitcher on Tue, 10 Apr 2018 13:42:02 GMT]]></title><description><![CDATA[<p dir="auto">I know this is an old topic but in case anyone has had this question, I was able to use a PIR sensor with the MMM-ProfileSwitcher module.  I simply added modified this section of MMM-ProfileSwitcher.js with the lines in bold:</p>
<pre><code>    // Override the default NotificationRecieved function
    notificationReceived: function (notification, payload, sender) {
        if (notification === "DOM_OBJECTS_CREATED") {
            Log.log("Hiding all non default modules.");
            this.set_profile(this.config.includeEveryoneToDefault);
            this.sendNotification("CHANGED_PROFILE", {to: this.config.defaultClass});
        } else if (notification === "CURRENT_PROFILE") {
            this.change_profile(payload);
        } &lt;strong&gt;else if (notification == 'USER_PRESENCE') {
                this.change_profile("Profile2")&lt;/strong&gt;
            }

},
</code></pre>
<p dir="auto">To explain, the MMM-PIR-Sensor module sends a notification to all modules when it detects movement.  The notification is “USER_PRESENCE”.  You simply check for it within your MMM-ProfileSwitcher module and tell it to change the profile.  Hope this helps</p>
]]></description><link>https://forum.magicmirror.builders/post/38231</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/38231</guid><dc:creator><![CDATA[acabrera2012]]></dc:creator><pubDate>Tue, 10 Apr 2018 13:42:02 GMT</pubDate></item></channel></rss>