Did you ever get this one figured out? I am having one hell of an issue trying to get the monitors to turn off. Pin 24 shuts the system down fine. I can change the payload to brightness instead and it works perfectly. But it seems that there’s a disconnect between the MMM-Buttons and the MMM-Remote-Control customCommand section through either running the command alone or in a script. When I run the script or command in terminal through SSH they work fine, but when envoked from MMM it’s ignored or goes no where.
module: 'MMM-Remote-Control',
//https://github.com/Jopyth/MMM-Remote-Control
disabled: false,
//position: 'bottom_left', // Required to show URL/QR code on mirror
// you can hide this module afterwards from the remote control itself
config: {
customCommand: {
//monitorOnCommand: '/home/pi/MagicMirror/config/mm-dispOn.sh',
//monitorOffCommand: '/home/pi/MagicMirror/config/mm-dispOff.sh',
monitorStatusCommand: 'wlr-randr | grep -q "Enabled: yes" && echo "true" || echo "false"',
monitorOnCommand: 'wlr-randr --output HDMI-A-1 --on',
monitorOffCommand: 'wlr-randr --output HDMI-A-1 --off',
},
secureEndpoints: false, // Optional, See API/README.md
// uncomment any of the lines below if you're gonna use it
// customMenu: "custom_menu.json", // Optional, See "Custom Menu Items" below
// apiKey: "", // Optional, See API/README.md for details
// classes: {}, // Optional, See "Custom Classes" below
showModuleApiMenu: false, // Optional, disable the Module Controls menu
// showNotificationMenu: false, // Optional, disable the Notification menu
// QR Code options (new!)
// showQRCode: true, // Optional, display QR code for easy mobile access (default: true)
// qrCodeSize: 150, // Optional, size of QR code in pixels (default: 150)
// qrCodePosition: "below" // Optional:
// "below" - Show URL above, QR code below (default)
// "above" - Show QR code above, URL below
// "replace" - Show only QR code, no URL text
}
},
{
module: "MMM-Buttons",
//https://github.com/KristjanESPERANTO/MMM-Buttons
disabled: false,
position: "bottom_right",
config: {
buttons: [
{
pin: 25,
name: "monitor_control",
activeLow: true,
longPress: [
{
title: "Monitor off",
message: "Keep pressed for 3 seconds to switch the monitor down",
imageFA: "display",
notification: "REMOTE_ACTION",
payload: {action: "monitorOffCommand"},
//payload: { action: "BRIGHTNESS", value: 10 }
},
],
shortPress: [
{
title: "Monitor on",
message: "Short press for monitor on",
imageFA: "display",
notification: "REMOTE_ACTION",
payload: {action: "monitorOnCommand"},
//payload: { action: "BRIGHTNESS", value: 100 }
},
]
},
{
pin: 24,
name: "power",
activeLow: true,
longPress: [
{
title: "Power off",
message: "Keep pressed for 3 seconds to shut down",
imageFA: "power-off",
notification: "REMOTE_ACTION",
payload: {action: "SHUTDOWN"},
},
]
}
]
}
},