tom-hirschberger / mmm-screen-powersave-notification Goto Github PK
View Code? Open in Web Editor NEWAn MagicMirror² Module which turns the screen on and off based on notifications
License: MIT License
An MagicMirror² Module which turns the screen on and off based on notifications
License: MIT License
Hi,
i'm having trouble to turn on and off the screen.
I've installed MQTTbridge and it's connected to the broker.
Then i've tested if xrandr is working and found that the default is set to WAYLAND not X11, so i turned back to X11 to get xrandr working "sudo raspi-config" - select "6 - advanced options" then "A6-Wayland" and switch to X11
(should be niticed in readme ;) found here
But i can't figure out how to toggle the xrandr_control script
When sending a payload OFF to the Topic MMM-Screen-Powersave-Notification is responding with SCREENSAVE_ENABLED but screen stays on. When sending ON, nothing happens ( i guess because Screen is already on)
config.js
{
module: 'MMM-Screen-Powersave-Notification',
config:
{
delay: 60,
profiles:
{
screenStatusCommand: "./modules/MMM-Screen-Powersave-Notification/controlScripts/xrandr_control status HDMI-1",
screenOnCommand: "./modules/MMM-Screen-Powersave-Notification/controlScripts/xrandr_control on HDMI-1",
screenOffCommand: "./modules/MMM-Screen-Powersave-Notification/controlScripts/xrandr_control off HDMI-1"
}
}
},
mqttDictionary.js
var mqttHook = [
{
mqttTopic: "magicmirror/state/monitor",
mqttPayload: [
{
payloadValue: "ON",
mqttNotiCmd: ["Command 1"]
},
],
},
{
mqttTopic: "magicmirror/state/monitor",
mqttPayload: [
{
payloadValue: "OFF",
mqttNotiCmd: ["Command 2"]
},
],
},
];
var mqttNotiCommands = [
{
commandId: "Command 1",
notiID: "SCREEN_ON",
notiPayload: {action: 'screenOnCommand'}
},
{
commandId: "Command 2",
notiID: "SCREEN_OFF",
notiPayload: {action: 'screenOffCommand'}
},
];
module.exports = { mqttHook, mqttNotiCommands};
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.