Skip to content
An MagicMirror² Module which turns the screen on and off based on notifications
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
callbackScripts
.gitignore
LICENSE
MMM-Screen-Powersave-Notification.js
README.md
node_helper.js
package.json

README.md

MMM-Screen-Powersave-Notification

MMM-Screen-Powersave-Notification is a module for the MagicMirror project by Michael Teeuw and is based on https://github.com/mboskamp/MMM-PIR and https://github.com/mboskamp/MMM-PIR.

It uses notifications to check for user presence or forced on and offs of the screen. After a configurated time without user presence the display will turn off. Additionaly scripts can be run after the screen turned of or on.

Installation

    cd ~/MagicMirror/modules
    git clone git@github.com:Tom-Hirschberger/MMM-Screen-Powersave-Notification.git
    cd MMM-Screen-Powersave-Notification
    npm install

Configuration

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

    {
        module: 'MMM-Screen-Powersave-Notification',
        config: {
            delay: 60,
        }
    }

Option Description Type Default
delay time before the mirror turns off the display if no user activity is detected. (in seconds) Integer 60
screenOnCommand the command which is used to turn the screen on String '/usr/bin/vcgencmd display_power 1'
screenOffCommand the command which is used to turn the screen off String '/usr/bin/vcgencmd display_power 0'
screenStatusCommand the command which is used to check if the screen is on (result needs to be 'display_power 1' if on) String '/usr/bin/vcgencmd display_power'

Notifications

Notification Payload Default Result
USER_PRESENCE true (mandatory) the timeout to turn of the screen will be reseted
SCREEN_OFF forced=true or false false turns the screen off; if the forced option is set to true also if the screen was turned on forced
SCREEN_ON forced=true or false false turns the screen on; if the forced option is set to true also if the screen was turned off forced
SCREEN_TOGGLE forced=true or false false switches the state of the screen; the forced option will be used for on off like in SCREEN_ON or SCREEN_OFF
SCREEN_POWERSAVE delay=NUMBER delay=0 can be used to set the delay for the timeout to an different value (or deactivate it if 0) during runtime
You can’t perform that action at this time.