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();
}
}
} );