After a configurated time without any user interaction the display will turn off and hide all modules for economy mode.
This module is an Extented plugins for MMM-GoogleAssistant
In addition, you can use others EXT modules to control it or add some pretty plugins:
EXT-Pir
: For PIR Sensor usingEXT-Governor
: For Manage your CPUEXT-Motion
: For detecting all motions with a webcam (optional)EXT-Updates
: For update automaticaly this module (Optional)EXT-Alert
: For display some information or error on your screen (Optional)Clone the module into your MagicMirror module folder and execute npm intall
in the module's directory.
cd ~/MagicMirror/modules
git clone https://github.com/bugsounet/EXT-Screen
cd EXT-Screen
npm install
This module will verify if all screen saver is disabled and disable it if needed
To display the module insert it in the config.js file.
{
module: 'EXT-Screen',
position: 'top_left',
animateIn: "flipInX",
animateOut: "flipOutX",
config: {
delay: 2 * 60 * 1000
}
},
This is the default configuration defined if you don't define any value.
Don't copy/past the entire default config, just add in default config your needed new change value !
all new value will automaticaly be merged with the default config
{
module: 'EXT-Screen',
position: 'top_left',
animateIn: "flipInX",
animateOut: "flipOutX",
config: {
debug: false,
animateBody: true,
autoDimmer: true,
delay: 2 * 60 * 1000,
mode: 1,
xrandrForceRotation: "normal",
wrandrForceRotation: "normal",
wrandrForceMode: null,
displayCounter: true,
displayBar: true,
displayStyle: "Text",
displayLastPresence: true,
lastPresenceTimeFormat: "LL H:mm",
displayAvailability: true,
detectorSleeping: false,
gpio: 20,
clearGpioValue: true,
sound: false,
touchMode: 3,
ON: [],
OFF: []
}
},
Option Description Type Default animateBody Animate MagicMirror on turn on/off the screen Boolean true autoDimmer screen dimmer when timeout is 1/3 time left and use opacity from 100% to 0% Boolean true delay Time before the mirror turns off the display if no user activity is detected. (in ms) Number 120000 mode mode for turn on/off your screen (see bellow) number 1 xrandrForceRotation -mode 9 only- Forces screen rotation according to the defined value (possible value: "normal", "left", "right", "inverted") string normal wrandrForceRotation -mode 10 only- Forces screen rotation according to the defined value (possible value: "normal", "90", "180", "270", "flipped", "flipped-90", "flipped-180", "flipped-270") string normal wrandrForceMode -mode 10 only- Force screen resolution mode (sample: wrandrForceMode: "1920x1080",) String null displayCounter Should display Count-down in screen ? Boolean true displayBar Should display Count-up bar in screen ? Boolean true displayStyle Style of the Count-down. Available: "Text", "Line", "SemiCircle", "Circle" String Text displayLastPresence Display the date of the last user presence Boolean true lastPresenceTimeFormat Change the date format (moment.js format) of the last presence String LL H:mm displayAvailability Display screen availability time (average 24h) Boolean true detectorSleeping Activate EXT-Detector only when display is on Boolean false gpio GPIO number for control the relay (mode 6 only) Number 20 clearGpioValue reset GPIO value script of relay (mode 6 and 7 only) Boolean true sound emit a sound when your screen turn on/off Boolean false touchMode Selected mode for enable/disable the screen with touch (see below) number 3 ON Defined cron ON display time (see below) Array of object [] OFF Defined cron OFF display time (see below) Array of object []
mode: 0
- don't turn off your screen and hide all modulesmode: 1
- use vgencmd (For raspbian 10/11)mode: 2
- use dpms (For raspbian 10/11 and raspbian 12 with x11 compositor)mode: 3
- use tvservice (For raspbian 10/11)mode: 4
- use HDMI CECmode: 5
- use dpms (linux version for debian, ubuntu, ...)mode: 6
- use a relay switch command controled by GPIOmode: 7
- use a relay switch command controled by GPIO with python (read reverse values)mode: 8
- use ddcutilmode: 9
- use xrandr (For raspbian 11 or raspbian 12 with x11 compositor)mode: 10
- use wlr-randr (For rapsbian 12 with wayland compositor)touchMode: 0
touchMode: 1
touchMode: 2
touchMode: 3
ON: []
and OFF: []
This is the rule to Turn ON et Turn OFF your screen
If you use
EXT-Pir
orEXT-Motion
: You don't have to use this feature
Each event have an object format:
{
dayOfWeek: <Array of days>,
hour: <hour>,
minute: <minute>
}
dayOfWeek is an array of number
This number define the day:
0
: Sunday
1
: Monday
2
: Tuesday
3
: Wednesday
4
: Thursday
5
: Friday
6
: Saturday
sample if you want to create an event from Monday to Thursday at 07h45:
{
dayOfWeek: [1,2,3,4],
hour: 07,
minute: 45
}
sample if you want to create an event every Friday at 08h00
{
dayOfWeek: [5],
hour: 08,
minute: 00
}
sample if you want to create an event from Monday to Friday at 17h00
{
dayOfWeek: [1,2,3,4,5],
hour: 17,
minute: 00
}
Let's create ON and OFF now
I want to apply this rules:
---> Screen is ON:
So, ON
rules will be:
ON: [
{
dayOfWeek: [1,2,3,4],
hour: 07,
minute: 45
},
{
dayOfWeek: [5],
hour: 08,
minute: 00
}
],
---> Screen is OFF
So, OFF
rules will be:
OFF: [
{
dayOfWeek: [1,2,3,4,5],
hour: 17,
minute: 00
}
]
Let's apply your own rules !
When
ON
event started: counter will be not displayed
WhenOFF
event started: counter will be functional and turn off the screen when done
Don't be stupid! Don't create an ON event equal to OFF event
This plugin broadcasts:
EXT_SCREEN-POWER
with payload: true
when your screen turn on or false
when your screen turn off.This plugin receive:
EXT_SCREEN-END
notification to force the end of the count downEXT_SCREEN-WAKEUP
notification to wake up the screen and reset count downEXT_SCREEN-LOCK
notification keep the screen on and lock it (freeze counter and stop pir detection)EXT_SCREEN-UNLOCK
notification unlock the screen and restart counter and pir detectionEXT_SCREEN-FORCE_END
notification to force turn off your screen (and stop counter and pir detection)EXT_SCREEN-FORCE_WAKEUP
notification to force turn on your screen (restart counter and pir detection)Note:
EXT_SCREEN-FORCE_END
waitEXT_SCREEN-FORCE_WAKEUP
ONLY for wakeup the screen
cd ~/MagicMirror/modules/EXT-Screen
npm run update