MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Motion Detector

    Scheduled Pinned Locked Moved Utilities
    213 Posts 38 Posters 486.6k Views 39 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      danielis
      last edited by

      Never monitors turn off by themselve as soon as there is no signal or after a few minutes without signal. Mine was a old that did not turn on/off automatically.
      I used wiringpi to activate a relais that turns the current of the monitor on and off.

      1 Reply Last reply Reply Quote 0
      • P Offline
        pepemujica
        last edited by

        @danielis
        Sorry I can’t get your point as English is not my first language.
        What I’m saying is that when the camera does not detect any movement, and the timeout setted is out, the monitor does not show the mirror, but after a few seconds appears something like this:
        0_1495564666424_upload-299d3f7e-ab18-477b-a821-071edeee684f

        1 Reply Last reply Reply Quote 0
        • D Offline
          danielis
          last edited by

          OK
          But if there is a movement detected - is then the mirror shown?

          Why do you expect to see the mirror after the timeout?

          The mirror must be on if there is a movement. And if there is no movement and the timeout is over, then is the mirror off.
          That is what you want and what this module is doing.

          I think your problem is that as soon as the mirror is off, your monitor should turn off - right?

          P 1 Reply Last reply Reply Quote 0
          • P Offline
            pepemujica @danielis
            last edited by

            @danielis said in Motion Detector:

            ur problem is that as soon as the mirror is off, your monito

            Yes sir, that is my problem, the module seems to be working fine, but it is a bit annoying to see the alert when the mirror is off

            1 Reply Last reply Reply Quote 0
            • D Offline
              danielis
              last edited by yawns

              Yes, that was what I tried to say in my first post yesterday.
              I had the same problem.
              Old monitors do not turn off by themselve if there is no signal. Newer monitor do turn off, and all is fine.

              My solution was tu use a relais to turn on/off the current of the monitor. Therefore I used a pin of the GPIOs to control the relais.

              For controlling this GPIO pin I used the wiringpi library

              I had to add some lines in the node_helper.js - please look at the lines with: exec("gpio -g …

              pi@magicmirror:~/MagicMirror/modules/motiondetector $ more node_helper.js

              'use strict';
              
              /* Magic Mirror
               * Module: MMM-PIR-Sensor
               *
               * By Paul-Vincent Roll http://paulvincentroll.com
               * MIT Licensed.
               */
              
              const NodeHelper = require('node_helper');
              const exec = require('child_process').exec;
              var moment = require('moment');
              
              module.exports = NodeHelper.create(
              {
                start: function ()
                {
                      //this.started = false;
                      exec("gpio -g write 4 1", null);
                      console.log('motiondetector started ...');
                      console.log('monitor relais on');
                },
                activateMonitor: function ()
                {
                      exec("gpio -g write 4 1", null);
                      console.log(moment().format() + ' monitor relais on');
                      //this.started = false;
                },
                deactivateMonitor: function ()
                {
                      exec("gpio -g write 4 0", null);
                      console.log(moment().format() + ' monitor relais off');
                      //this.started = false;
                },
                socketNotificationReceived: function (notification)
                {
                    //const self = this;
                    if (notification === 'MOTION_DETECTED')
                    {
                        //const self = this;
                        //this.started = true;
                        this.activateMonitor();
                    }
                    if (notification === 'DEACTIVATE_MONITOR')
                    {
                        //const self = this;
                        //this.started = true;
                        this.deactivateMonitor();
                    }
                }
              } );
              
              P 1 Reply Last reply Reply Quote 0
              • P Offline
                pepemujica @danielis
                last edited by

                @danielis Hi! I’ve tried, but still can’t get it. So I was thinking, instead of putting of the monitor, is it possible to show a black image for example?
                So when it detects movement, the MM appears, and when not, a black photo is shown.
                Is it possible?

                yawnsY 1 Reply Last reply Reply Quote 0
                • yawnsY Offline
                  yawns Moderator @pepemujica
                  last edited by

                  @pepemujica
                  There is a module called HideAll (or something similar) which simply hides all modules and leaves a black background. Maybe you want to try it

                  1 Reply Last reply Reply Quote 2
                  • KimzerK Offline
                    Kimzer
                    last edited by

                    Could someone please write up a working instruction for the motion detector with the rasperry pi camera? Not the pir sensor, need to make use of the camera somehow. :)

                    bheplerB 1 Reply Last reply Reply Quote 1
                    • mickyasM Offline
                      mickyas @alexyak
                      last edited by

                      @alexyak Does this module switch off the pi, i’m only asking since i have Alexa running in the background which requires 3 terminals to be open all the time? If the pi goes into ‘standby’ or goes off i have to re-enter the information into the 3 terminals consecutively to get it up and running again. Thanks
                      Mick

                      1 Reply Last reply Reply Quote 0
                      • bheplerB Offline
                        bhepler Module Developer @Kimzer
                        last edited by

                        @Kimzer I wrote up a method using a version of Motion for the RasPi. It’s under the tutorials section of the forum. It’s a non-module solution, so there’s some weirdness involved. But I did get it to work with a Raspicam.

                        @mickyas - This module doesn’t switch off the pi, it just switches off the output to the monitor.

                        cowboysdudeC 1 Reply Last reply Reply Quote 2
                        • 1
                        • 2
                        • 15
                        • 16
                        • 17
                        • 18
                        • 19
                        • 20
                        • 21
                        • 22
                        • 17 / 22
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Sam, technical setup by Karsten.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy