Skip to content
MagicMirror Action with PIR Sensor
JavaScript Shell CSS
Branch: master
Clone or download

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
scripts update installer Jan 31, 2020
LICENSE Initial commit Aug 31, 2019
MMM-NewPIR.css Debug mode Dec 11, 2019
MMM-NewPIR.js Add reverseValue Feature Feb 19, 2020
README.md Update README.md Feb 19, 2020
node_helper.js not needed Feb 19, 2020
package.json Update package.json Feb 19, 2020

README.md

MMM-NewPIR

MMM-NewPIR is a module for the MagicMirror project by Michael Teeuw.

It uses a PIR sensor attached to your raspberry pi's GPIO pins to check for users. After a configurated time without any user interaction the display will turn off and hide all module for economy mode.

If you don't have PIR sensor, it can also be used for automatic turn on / turn off screen.

MMM-AssistantAMk2 v3 Ready

Installation

Clone the module into your MagicMirror module folder and execute npm intall in the module's directory.

git clone https://github.com/bugsounet/MMM-NewPIR.git
cd MMM-NewPIR
npm install

Note for RPI4 user

RPI4 firmware not support actually vcgencmd display_power command.

So, turn off display should not working

Configuration

To display the module insert it in the config.js file. Here is an example:

{
  module: 'MMM-NewPIR',
  position: 'top_left',
  config: {
    useSensor: true,
    sensorPin: 21,
    reverseValue: false,
    delay: 2* 60 * 1000,
    turnOffDisplay: true,
    ecoMode: true,
    governor: "",
    debug: false
  }
},

Option Description Type Default
useSensor Use sensor or not Boolean true
sensorPin BCM-number of the sensor pin Integer 21
reverseValue Set it to false if sensor detect presence on value 1. Set it to true if sensor detect presence on value 0 Bloolean  false
delay Time before the mirror turns off the display if no user activity is detected. (in ms) Integer 60000 (1 minutes)
turnOffDisplay Should the display turn off after timeout? Boolean true
ecoMode Should the MagicMirror hide all module after timeout ? Boolean true
governor Set CPU Governor on start. Available : conservative ondemand userspace powersave performance or set "" for no change String ""

Developer Notes

  • This module broadcasts a USER_PRESENCE notification with the payload beeing true or false you can use it to pause or disable your module.
  • This module receive USER_PRESENCE notification with the payload true to force user presence or false to force delay to time out.

Change Log

2020-19-02

  • add reverseValue Feature :
    • Set it to false if sensor detect presence on value 1.
    • Set it to true if sensor detect presence on value 0

2020-21-01

  • Correct possibility fix Gpio issue ?

2020-18-01

  • correct USER_PRESENCE { false } notification receive

2019-12-12

  • add useSensor feature

2019-12-11

  • V2 initial commit
  • Rewrite code
You can’t perform that action at this time.