<?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[Notifications and commands help please.]]></title><description><![CDATA[<p dir="auto">Hi all, I’m new here so be gentle. I’m by no means a coder or anything like that, however with plenty of tutorials and this awesome forum I’ve managed to get the majority of my mirror set up how I like it. My question is the notification system:</p>
<p dir="auto">I’m using pikrellcam to look after the camera on my Pi3, this can receive commands:</p>
<pre><code>echo "motion_enable on" &gt; ~/pikrellcam/www/FIFO
echo "motion_enable off" &gt; ~/pikrellcam/www/FIFO
</code></pre>
<p dir="auto">My idea is to use MMM-NetworkScanner to ping my mobile, then broadcast the relevant command<br />
i.e. if I’m at home - turn motion detect off, when I go out - turn motion detect on.</p>
<p dir="auto">I can get it to ping my phone, and broadcast notifications, but I have no idea how to get it to issue commands - any ideas?</p>
<p dir="auto">Am I even going about this the right way?</p>
<p dir="auto">Thanks in advance, Jon.</p>
]]></description><link>https://forum.magicmirror.builders/topic/6977/notifications-and-commands-help-please</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Jul 2026 09:51:25 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/6977.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 13 Apr 2018 18:54:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Notifications and commands help please. on Sun, 15 Apr 2018 14:05:26 GMT]]></title><description><![CDATA[<p dir="auto">So I did some quick googling over coffee this morning. I think there is a two part suggestion for you. Please note, this will require research and testing which I have not done, this is just directional.</p>
<ol>
<li>Install MMM-RemoteControl - <a href="https://github.com/Jopyth/MMM-Remote-Control" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/Jopyth/MMM-Remote-Control</a></li>
<li>Add some custom code to the MMM-Remote-Control module to handle requests for turning on/off the motion device.</li>
</ol>
<p dir="auto">In MMM-Remote-Control’s node_helper.js module, you can find the “MONITORON” code:</p>
<pre><code>if (query.action === "MONITORON")
		{
			exec("tvservice --preferred &amp;&amp; sudo chvt 6 &amp;&amp; sudo chvt 7", opts, function(error, stdout, stderr){ self.checkForExecError(error, stdout, stderr, res); });
			return true;
}
</code></pre>
<p dir="auto">Notes:</p>
<ul>
<li>query.action defines a trigger word for the MMM-RemoteControl to listen for.</li>
<li>exec() - executes a command on the OS</li>
<li>The rest is for error checking that the external command executed.</li>
</ul>
<p dir="auto">In your case, we could define the following:</p>
<pre><code>if (query.action === "MOTIONON")
		{
			exec("echo "motion_enable on" &gt; ~/pikrellcam/www/FIFO", opts, function(error, stdout, stderr){ self.checkForExecError(error, stdout, stderr, res); });
			return true;
}

if (query.action === "MOTIONOFF")
		{
			exec("echo "motion_enable off" &gt; ~/pikrellcam/www/FIFO", opts, function(error, stdout, stderr){ self.checkForExecError(error, stdout, stderr, res); });
			return true;
}
</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/38415</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/38415</guid><dc:creator><![CDATA[Privacywonk]]></dc:creator><pubDate>Sun, 15 Apr 2018 14:05:26 GMT</pubDate></item><item><title><![CDATA[Reply to Notifications and commands help please. on Sun, 15 Apr 2018 11:33:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/privacywonk" aria-label="Profile: Privacywonk">@<bdi>Privacywonk</bdi></a>  Thanks for your idea, tried it today and it just comes up with ‘Please create a config file’.<br />
I tried putting the command inside { }, " ", and ’ '.</p>
<p dir="auto">Any other ideas?</p>
]]></description><link>https://forum.magicmirror.builders/post/38410</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/38410</guid><dc:creator><![CDATA[qwertyjon]]></dc:creator><pubDate>Sun, 15 Apr 2018 11:33:47 GMT</pubDate></item><item><title><![CDATA[Reply to Notifications and commands help please. on Sat, 14 Apr 2018 16:29:45 GMT]]></title><description><![CDATA[<p dir="auto">as part of the configuration file for MMM-NetworkScanner there is an “occupiedCMD” and “vacantCMD” that you could try setting with the command sequence above. I haven’t used this tool yet so I am unsure what sort of commands can be passed.</p>
]]></description><link>https://forum.magicmirror.builders/post/38388</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/38388</guid><dc:creator><![CDATA[Privacywonk]]></dc:creator><pubDate>Sat, 14 Apr 2018 16:29:45 GMT</pubDate></item></channel></rss>