@Cr4z33 indeed, strange, I will check my code this evening (I did it by “memory” since this morning…).
Read the statement by Michael Teeuw here.
Posts made by bolish
-
RE: [MMM-Remote-Control](v2-dev) Extensible REST API, Dynamic Menus, and Socket Communications, plus other updates
-
RE: [MMM-Remote-Control](v2-dev) Extensible REST API, Dynamic Menus, and Socket Communications, plus other updates
Just replace related lines by the following ones (it’s approx. around line 610) into your node.js :
if (["MONITORTOGGLE", "MONITORSTATUS", "MONITORON"].indexOf(action) !== -1) { screenStatus = exec(monitorStatusCommand, opts, (error, stdout, stderr) => { if (stdout.indexOf("power status: standby") !== -1 || stdout.indexOf("false") !== -1) { // MODIF DONE HERE // Screen is OFF, turn it ON status = "off"; if (action === "MONITORTOGGLE" || action === "MONITORON") { exec(monitorOnCommand, opts, (error, stdout, stderr) => { this.checkForExecError(error, stdout, stderr, res, { monitor: "on" }); }); this.sendSocketNotification("USER_PRESENCE", true); return; } } else if (stdout.indexOf("power status: on") !== -1 || stdout.indexOf("true") !== -1) { // MODIF DONE HERE // Screen is ON, turn it OFF status = "on"; if (action === "MONITORTOGGLE") { this.monitorControl("MONITOROFF", opts, res); return;
-
RE: MMM-GroveGestures
No, if it’s works by sending the request, it should work with Gesture also!
-
RE: [MMM-Remote-Control](v2-dev) Extensible REST API, Dynamic Menus, and Socket Communications, plus other updates
No. From my understanding, you only need to modify the customcommands into your config file not in the node.js.
The one you mention into your post (extract of node.js) are the default ones, don’t modify them.
What you need to modify into node.js are the ouput conditions as I posted above because the way the node.js is written (and how it’s explained on git) those commands will only work if your ouput are :
customCommand: { monitorOnCommand: 'shell command to turn on your monitor', monitorOffCommand: 'shell command to turn off your monitor', monitorStatusCommand: 'shell command to return status of monitor, must return either "HDMI" or "true" if screen is on; or "TV is Off" or "false" if it is off to be recognized' }
That’s why we need to replace those conditions into the node.js by the one we get with our TV’s (which are different than the “true” / “flase” “TV is on” etc… but are “power status : stand by” and “power status: on”).
Clear now??
-
RE: [MMM-Remote-Control](v2-dev) Extensible REST API, Dynamic Menus, and Socket Communications, plus other updates
This is what I did on my side :
if (["MONITORTOGGLE", "MONITORSTATUS", "MONITORON"].indexOf(action) !== -1) { screenStatus = exec(monitorStatusCommand, opts, (error, stdout, stderr) => { if (stdout.indexOf("TV is off") !== -1 || stdout.indexOf("false") !== -1) { // REPLACE "TV is off" or "false" by "power status: standby" // Screen is OFF, turn it ON status = "off"; if (action === "MONITORTOGGLE" || action === "MONITORON") { exec(monitorOnCommand, opts, (error, stdout, stderr) => { this.checkForExecError(error, stdout, stderr, res, { monitor: "on" }); }); this.sendSocketNotification("USER_PRESENCE", true); return; } } else if (stdout.indexOf("HDMI") !== -1 || stdout.indexOf("true") !== -1) { // REPLACE "HDMI" OR "true" by "power status: on" // Screen is ON, turn it OFF status = "on"; if (action === "MONITORTOGGLE") { this.monitorControl("MONITOROFF", opts, res); return;
At least this is what worked for me.
-
RE: [MMM-Remote-Control](v2-dev) Extensible REST API, Dynamic Menus, and Socket Communications, plus other updates
@Cr4z33 same as me…let’s try to cross check our node helper .js to see if they are written the same on line 610 and 620.
-
RE: [MMM-Remote-Control](v2-dev) Extensible REST API, Dynamic Menus, and Socket Communications, plus other updates
@Cr4z33
Strange, it worked for me… FMI, what output do you get in the terminal with “echo pow 0 | cec-client -s -d 1”.
When the screen is ON? When the screen is “OFF”? -
RE: MMM-GroveGestures
@Benjaminh86
Not really…“MONITORON” is already an action which is managed by MMM-REMOTECONTROL so you don’t need MMM-Notificationtrigger for that.
You just need MMM-GroveGesture to send it :
"UP": { notificationExec: { notification: "REMOTE_ACTION", payload: { action: "MONITORON", }, // you don't need to refer to a module name for the MONITORONN action (only necessary for HIDE and SHOW) }
But you need to make sure that MMM-REMOTEControl is configured in the right way so that when it receives “MONITORON” it sends the right command (depending if you use HDMI, CEC, etc…)
Regards
-
RE: [MMM-Remote-Control](v2-dev) Extensible REST API, Dynamic Menus, and Socket Communications, plus other updates
@Cr4z33
So, the ouput you got in the terminal by sending the “pow 0” command is in line with what is written into node helper.js line 610 / 620? -
RE: [MMM-Remote-Control](v2-dev) Extensible REST API, Dynamic Menus, and Socket Communications, plus other updates
@Cr4z33
Make trials with your terminal :- Turn screen on by pasting that in your terminal : echo on 0 | cec-client -s -d 1
- Check the feedback status sent by the TV by putting that in terminal : echo pow 0 | cec-client -s -d 1
- Remind the result
Do exactly the same with turn off :
- Turn screen on by pasting that in your terminal : echo standby 0 | cec-client -s -d 1
- Check the feedback status sent by the TV by putting that in terminal : echo pow 0 | cec-client -s -d 1
- Remind the result
The 2 results you will get should be updated in node.js line 610 / 620.