<?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-SleepWake using external motion detection source]]></title><description><![CDATA[<h1>Description</h1>
<p dir="auto">Enable MagicMirror sleep from external (camera) sources</p>
<p dir="auto">If you are running the MM on a non PI device, or want to control sleep/wake without having to wire up another device, this module will take external info and signal MM to sleep or wake up.</p>
<p dir="auto">I use a Webcam camera for the motion detection, driven by the github Motion project.<br />
That project allows for a script to be run when motion starts and ends.  I provide a script that<br />
creates a file for both events, and the module detects those files.</p>
<p dir="auto">the module supports sleep and wake 3 different ways… On PI using the tvservice command, or the exec dpms command if not using HDMI, or hiding all modules if using an energystar monitor (like my tv)</p>
<p dir="auto">I have submitted changes to MMM-voice and HelloLucy to allow our modules to know about the others processing… so voice Go To Sleep and motion wakeup work… if using the Hide method, modules already hidden at sleep will remain hidden on wakeup.</p>
<h1>Download:</h1>
<p dir="auto">[card:sdetweil/MMM-SleepWake]</p>
<hr />
<h2>Version 1.0</h2>
]]></description><link>https://forum.magicmirror.builders/topic/7364/mmm-sleepwake-using-external-motion-detection-source</link><generator>RSS for Node</generator><lastBuildDate>Fri, 15 May 2026 01:52:59 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/7364.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 10 Jun 2018 17:45:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MMM-SleepWake using external motion detection source on Sat, 24 Aug 2019 16:29:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mithatcak" aria-label="Profile: mithatcak">@<bdi>mithatcak</bdi></a> interesting</p>
]]></description><link>https://forum.magicmirror.builders/post/60371</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/60371</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 24 Aug 2019 16:29:03 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-SleepWake using external motion detection source on Sat, 24 Aug 2019 16:22:16 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> Good news, switching to new <code>weather</code> module fixed the issue.</p>
]]></description><link>https://forum.magicmirror.builders/post/60370</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/60370</guid><dc:creator><![CDATA[mithatcak]]></dc:creator><pubDate>Sat, 24 Aug 2019 16:22:16 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-SleepWake using external motion detection source on Thu, 22 Aug 2019 22:24:46 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> Unfortunately same result :/ I will try to replace <code>currentweather</code> and <code>weatherforecast</code> with <a href="https://github.com/MichMich/MagicMirror/tree/master/modules/default/weather" target="_blank" rel="noopener noreferrer nofollow ugc">weather</a> module and see if it’s going to make any difference.</p>
]]></description><link>https://forum.magicmirror.builders/post/60332</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/60332</guid><dc:creator><![CDATA[mithatcak]]></dc:creator><pubDate>Thu, 22 Aug 2019 22:24:46 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-SleepWake using external motion detection source on Thu, 22 Aug 2019 12:36:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mithatcak" aria-label="Profile: mithatcak">@<bdi>mithatcak</bdi></a> could you try something for me</p>
<p dir="auto">i cannot reproduce this on any of my systems…</p>
<p dir="auto">edit the MMM-SleepWake.js file</p>
<pre><code>		case "SLEEP_HIDE":
			MM.getModules().enumerate((module) =&gt; {
				// if the module is already hidden
				if(module.hidden==true)
					// save it for wake up
					{v_self1.previously_hidden.push(module.identifier);}
				else
					// hide this module
					{module.hide(1000);}   // &lt; --- change this line , remove the 1000 
```
should look like this
```
		case "SLEEP_HIDE":
			MM.getModules().enumerate((module) =&gt; {
				// if the module is already hidden
				if(module.hidden==true)
					// save it for wake up
					{v_self1.previously_hidden.push(module.identifier);}
				else
					// hide this module
					{module.hide();}
```

let me know</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/60319</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/60319</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Thu, 22 Aug 2019 12:36:41 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-SleepWake using external motion detection source on Wed, 21 Aug 2019 14:19:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mithatcak" aria-label="Profile: mithatcak">@<bdi>mithatcak</bdi></a> very interesting… I use those default modules too  and I have never seen that behavior.<br />
like they didn’t handle the suspend request…</p>
<p dir="auto">i have 4 systems running this everyday for months… only see the updatenotification module output on one as it doesn’t handle hide/suspend…</p>
<p dir="auto">i will do some additional debugging</p>
]]></description><link>https://forum.magicmirror.builders/post/60299</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/60299</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Wed, 21 Aug 2019 14:19:55 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-SleepWake using external motion detection source on Wed, 21 Aug 2019 13:56:38 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> I noticed a weird issue. sometimes after several sleep&amp;wake cycles, when it goes to sleep only the stock currentweather and weatherforecast modules stays on. there is no error in the motion.log or MM log.</p>
<p dir="auto">here is my config, I was using delay: 5 then switched to 0.2 so I can repeat the issue faster.</p>
<pre><code>{
			module: "MMM-SleepWake",
			config:{
				delay:  0.2,               // default
				source: "external",
				mode:  "HIDE"
			}
			 // detectionDir: folder containing externally generated file when motion starts
			 //               will be created if needed
			 // detectionFile:  filename generated for motion start. default = 'detected'
},
</code></pre>
<p dir="auto"><img src="/assets/uploads/files/1566395565442-screen-shot-2019-08-21-at-1.27.52-am-resized.png" alt="0_1566395564247_Screen Shot 2019-08-21 at 1.27.52 AM.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.magicmirror.builders/post/60298</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/60298</guid><dc:creator><![CDATA[mithatcak]]></dc:creator><pubDate>Wed, 21 Aug 2019 13:56:38 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-SleepWake using external motion detection source on Tue, 20 Aug 2019 14:47:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mithatcak" aria-label="Profile: mithatcak">@<bdi>mithatcak</bdi></a> glad its working !.. i use it everyday on multiple mirrors…</p>
]]></description><link>https://forum.magicmirror.builders/post/60268</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/60268</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Tue, 20 Aug 2019 14:47:32 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-SleepWake using external motion detection source on Mon, 19 Aug 2019 23:16:03 GMT]]></title><description><![CDATA[<p dir="auto">this is exactly what I need. works perfect! just hiding modules and no more ugly “NO SIGNAL” message floating on my mirror. Thank you!</p>
]]></description><link>https://forum.magicmirror.builders/post/60252</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/60252</guid><dc:creator><![CDATA[mithatcak]]></dc:creator><pubDate>Mon, 19 Aug 2019 23:16:03 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-SleepWake using external motion detection source on Mon, 11 Mar 2019 02:35:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/elleclouds" aria-label="Profile: elleclouds">@<bdi>elleclouds</bdi></a> ok…<br />
the motion module needs a video device…</p>
<p dir="auto">run these two commands</p>
<pre><code>sudo apt-get install v4l-utils
v4l2-ctl --list-devices
</code></pre>
<p dir="auto">find the ‘camera’ device in the list<br />
mine shows</p>
<pre><code>odroid@odroid:~/MagicMirror$ v4l2-ctl --list-devices
s5p-mfc-dec (platform:11000000.codec):
        /dev/video10
        /dev/video11

s5p-jpeg encoder (platform:11f50000.jpeg):
        /dev/video30
        /dev/video31

s5p-jpeg encoder (platform:11f60000.jpeg):
        /dev/video32
        /dev/video33

exynos-gsc gscaler (platform:13e00000.video-scaler):
        /dev/video20

exynos-gsc gscaler (platform:13e10000.video-scaler):
        /dev/video21

UVC Camera (046d:0825) (usb-xhci-hcd.3.auto-1.2):
        /dev/video0
</code></pre>
<p dir="auto">the last is the camera…</p>
<p dir="auto">so, in the motion.conf,</p>
<p dir="auto">set the line <strong>videodevice</strong> to the value returned for the camera, in my case <strong>/dev/video0</strong></p>
<pre><code># Videodevice to be used for capturing  (default /dev/video0)


# for FreeBSD default is /dev/bktr0
videodevice  /dev/video0
</code></pre>
<p dir="auto">after changing the config file<br />
either do</p>
<pre><code>ps -ef | grep motion
     get the process id (pid) use below
kill -s SIGHUP pid
</code></pre>
<p dir="auto">mine is</p>
<pre><code>odroid@odroid:~/MagicMirror$ ps -ef | grep motion
root      7756     1  0 Mar08 ?        00:14:21 motion
</code></pre>
<p dir="auto">pid = 7756</p>
<p dir="auto">or reboot</p>
]]></description><link>https://forum.magicmirror.builders/post/54054</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/54054</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Mon, 11 Mar 2019 02:35:00 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-SleepWake using external motion detection source on Mon, 11 Mar 2019 01:45:13 GMT]]></title><description><![CDATA[<p dir="auto">I am a noobie, but I feel like I followed most of the instructions I’ve found online on how to get this to work, but I’m still having some issues of actually getting the mirror to turn of or on.  I keep getting the error in terminal when I run motion : vid_v4lx_start: Failed to open video device /dev/video: No such file directory.</p>
<p dir="auto">I’d greatly appreciate a video or help with set up… A youtube video would save me time and troubleshooting something that may be simple.</p>
]]></description><link>https://forum.magicmirror.builders/post/54053</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/54053</guid><dc:creator><![CDATA[elleclouds]]></dc:creator><pubDate>Mon, 11 Mar 2019 01:45:13 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-SleepWake using external motion detection source on Tue, 26 Feb 2019 13:27:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/elleclouds" aria-label="Profile: elleclouds">@<bdi>elleclouds</bdi></a>  I didn’t want to learn all about cameras, or be on the hook for continuing configuration options for cameras… and I found this code that  handles all that AND signals motion</p>
<p dir="auto"><a href="https://motion-project.github.io/" target="_blank" rel="noopener noreferrer nofollow ugc">https://motion-project.github.io/</a></p>
<p dir="auto">on its configuration page its says</p>
<pre><code>Determine the type of camera
v4l2 devices which are most webcams
Composite capture cards
Network or IP cameras
The PI camera
Static movie files.
</code></pre>
<p dir="auto">it documents using the Raspberry Pi camera</p>
<pre><code>Raspberry Pi cameras can be set up two different ways. If Motion is installed by using the apt packages (e.g. apt-get install motion), then the camera must be set up using the bcm2835-v4l2 module which creates a v4l2 device for the camera. Users will need to install this module using the command sudo modprobe bcm2835-v4l2. This will set up the camera as a normal v4l2 device and it can be accessed via a standard /dev/videoX device. If Motion is built from source or installed via the deb packages on the project release page, then an additional option is to set up the camera using the mmalcam_name parameter or using the bcm2835-v4l2 module. When Motion is installed via apt, the mmalcam option is not available.
</code></pre>
<p dir="auto">Motion project can also record images on motion,  movies, etc,etc,etc,etc,</p>
]]></description><link>https://forum.magicmirror.builders/post/53209</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/53209</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Tue, 26 Feb 2019 13:27:39 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-SleepWake using external motion detection source on Mon, 25 Feb 2019 18:24:07 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> Can this script be used with a raspberry pi camera?  I want my mirror to wake and sleep upon detection from camera.  It there a step by step for a noob as myself?</p>
]]></description><link>https://forum.magicmirror.builders/post/53130</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/53130</guid><dc:creator><![CDATA[elleclouds]]></dc:creator><pubDate>Mon, 25 Feb 2019 18:24:07 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-SleepWake using external motion detection source on Sun, 24 Feb 2019 17:35:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/elleclouds" aria-label="Profile: elleclouds">@<bdi>elleclouds</bdi></a> I do not know. Is there a nest API the reports motion?</p>
<p dir="auto">I have not found the same for my ecobee room sensors</p>
<p dir="auto">If u can find the API, just call my little shell script to report start and end of movement</p>
]]></description><link>https://forum.magicmirror.builders/post/53090</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/53090</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sun, 24 Feb 2019 17:35:03 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-SleepWake using external motion detection source on Sun, 24 Feb 2019 16:48:03 GMT]]></title><description><![CDATA[<p dir="auto">Can this use a Nest Smoke Detector’s motion detecting as a trigger to activate SleepWake?</p>
]]></description><link>https://forum.magicmirror.builders/post/53087</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/53087</guid><dc:creator><![CDATA[elleclouds]]></dc:creator><pubDate>Sun, 24 Feb 2019 16:48:03 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-SleepWake using external motion detection source on Sun, 24 Jun 2018 00:28:39 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></p>
<p dir="auto">Well done, sir!</p>
]]></description><link>https://forum.magicmirror.builders/post/40771</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/40771</guid><dc:creator><![CDATA[Mykle1]]></dc:creator><pubDate>Sun, 24 Jun 2018 00:28:39 GMT</pubDate></item></channel></rss>