Read the statement by Michael Teeuw here.
MMM-Alexa Control with monitortoggle true -- but these command not work
-
@Chazzer you will have to edit the node helper and add another option, xrandr, with the appropriate commands
this module doesn’t allow you to configure the actual commands used.
in node_helper.js replicate this block (line 249)
else if(this.config.vcgencmd =='tvservice'){ device.handler = function(action) { if(action === 1){ exec("tvservice --preferred", opts, (error, stdout, stderr) => { _this.checkForExecError(error, stdout, stderr); }); }if(action === 0){ exec("tvservice --off", opts, (error, stdout, stderr) => { _this.checkForExecError(error, stdout, stderr); }); } } }
change this
else if(this.config.vcgencmd =='tvservice'){
to
else if(this.config.vcgencmd =='xrandr'){
and then change the two exec’s to the xrandr commands you documented…
then change the config.js option for vcgencmd to ‘xrandr’
-
@sdetweil
Hi Sam, thanks for your quick help. I’m starting to get a bit anxious. I’m not sure if I can do this and would really appreciate a step-by-step guide. I’m afraid I might mess things up if it goes wrong.Can you explain how to make a backup of the Magic Mirror on the Raspberry Pi? My head is spinning with all these thoughts. Go take Timmy for a walk!
-
@Chazzer backup see my scripts
https://github.com/sdetweil/MagicMirror-backup-restoreand changes, see the post above yours…
-
@sdetweil
Dear Sam, I wanted to express my heartfelt thanks. I’ve duplicated the entry and made all the settings accordingly. I must say, I’m thrilled! Alexa can now turn off and on the monitor. I’ll paste in the code snippet shortly.else if(this.config.vcgencmd =='xrandr'){ device.handler = function(action) { if(action === 1){ exec("xrandr --output HDMI-1 --auto --rotate right", opts, (error, stdout, stderr) => { _this.checkForExecError(error, stdout, stderr); }); }if(action === 0){ exec("xrandr --output HDMI-1 --off", opts, (error, stdout, stderr) => { _this.checkForExecError(error, stdout, stderr); }); } } }
now, if you had made a fork, downloaded this fork, changed and used git to commit , and push, you could have contributed this as a pull request for the author to add, so that others could benefit too…
one minor thing, the code block markers MUST be the first thing on the line
-
@Chazzer said in MMM-Alexa Control with monitortoggle true -- but these command not work:
@sdetweil
Dear Sam, I wanted to express my heartfelt thanks. I’ve duplicated the entry and made all the settings accordingly. I must say, I’m thrilled! Alexa can now turn off and on the monitor. I’ll paste in the code snippet shortly.else if(this.config.vcgencmd =='xrandr'){ device.handler = function(action) { if(action === 1){ exec("xrandr --output HDMI-1 --auto --rotate right", opts, (error, stdout, stderr) => { _this.checkForExecError(error, stdout, stderr); }); }if(action === 0){ exec("xrandr --output HDMI-1 --off", opts, (error, stdout, stderr) => { _this.checkForExecError(error, stdout, stderr); }); } } }
now, if you had made a fork, downloaded this fork, changed and used git to commit , and push, you could have contributed this as a pull request for the author to add, so that others could benefit too…
> one minor thing, the code block markers MUST be the first thing on the line
Hello Sam, I’m really a newcomer to the world of Linux and Magic Mirror! :-) The developer seems informed, already through my first forum post, and I’ve already sent him the corresponding code snippet. I don’t quite understand if the code is faulty. Could you please show me what you mean by “one minor thing, the code block markers MUST be the first thing on the line”?
-
@Chazzer on your post, which I edited, the code marker was on a line following the word shortly,
so the code block did not expand