🛑 MMM-PIR-Sensor-Lite is no longer developed, the GitHub repository has been archived since January 2024. We advise you to use MMM-Pir which is actively maintained by bugsounet!
This module manage monitor with PIR motion sensor (automatic standby when presence isn't detected).
Title, countdown and detection icon display may be enabled or disabled.
xrandr (default option). The use of vcgencmd (previous option) is always possible with an additional option. More information below...
In your terminal, go to your MagicMirror's Module folder:
cd ~/MagicMirror/modulesClone this repository:
git clone https://github.com/grenagit/MMM-PIR-Sensor-LiteGo to your MMM-PIR-Sensor-Lite's Module folder:
cd ~/MagicMirror/modules/MMM-PIR-Sensor-LiteInstall dependencies:
npm installConfigure the module in your config.js file.
In your terminal, go to your MMM-PIR-Sensor-Lite's Module folder:
cd ~/MagicMirror/modules/MMM-PIR-Sensor-LiteIncorporate changes from this repository:
git pullInstall dependencies:
npm installTo use this module, add it to the modules array in the config/config.js file:
modules: [
{
module: "MMM-PIR-Sensor-Lite",
position: "top_right",
config: {
sensorPin: 2, // GPIO pin
}
}
]The following properties can be configured:
| Option | Description |
|---|---|
sensorPin |
The GPIO pin of the sensor. This value is REQUIRED |
commandType |
The command used to manage monitor. Possible values: 'vcgencmd', 'xrandr' or 'xset' Default value: 'xrandr' |
hdmiPort |
The HDMI port (required for xrandr) Possible values: HDMI-1 or HDMI-2 Default value: HDMI-1 |
title |
The title. It's hidden if title: "" Default value: "Automatic Standby" |
rotation |
Direction of content rotation. Possible values: 'normal', 'left', 'right' or 'inverted' Default value: 'normal' |
deactivateDelay |
How often does the content needs to be fetched? (Milliseconds) Possible values: 1000 - 86400000 Default value: 15 * 60 * 1000 (15 minutes) |
updateInterval |
How often does the countdown needs to be updated? (Milliseconds) Possible values: 0 - 5000 Default value: 1000 (1 second) |
animationSpeed |
Speed of the update animation. (Milliseconds) Possible values: 0 - 5000 Default value: 1000 (1 second) |
showCountDown |
Show the countdown. Possible values: true or false Default value: true |
showDetection |
Show an icon at each presence detection. Possible values: true or false Default value: true |
hoursLabel |
Hours label Default value: 'h' |
minutesLabel |
Minutes label Default value: 'm' |
secondsLabel |
Seconds label Default value: 's' |
debugMode |
Activate debug mode (command is disabled) Possible values: true or false Default value: false |
Debian 11 Bullseye:
Due to a problem between vcgencmd on Raspberry Pi OS Bullseye, please use:
xrandr(default option).xsetwithcommandType: 'xset',in your MMM-PIR-Sensor-Lite's config.
Debian 10 Buster:
You can continue to use vcgencmd with commandType: 'vcgencmd', in your MMM-PIR-Sensor-Lite's config.
In your terminal, run the python script after replacing SENSOR_PIN by the GPIO pin of the sensor:
python3 -u ~/MagicMirror/modules/MMM-PIR-Sensor-Lite/pir.py SENSOR_PIN
PIR_STARTis displayed in your terminal when the PIR sensor start is confirmed!
USER_PRESENCEis displayed in your terminal when a presence is detected by the sensor!
In your terminal, go to your MagicMirror's folder:
cd ~/MagicMirrorRun MagicMirror in developper mode (with console):
npm run start:devYou can follow the information logged by MMM-PIR-Sensor-Lite starting with MMM-PIR-Sensor-Lite like this:
This module is licensed under the MIT Licens


