Read the statement by Michael Teeuw here.
MMM-AlexaControl or MMM-AlexaOn/Off setup
-
from the README.md
### Control devices These are configured devices you can use. If you want to change their name you must edit the translation file inside `/translations/en.json`. You can also add languages. | Option | Description | ----------------- | ----------- | `refresh` | This refreshs your Mirror. <br> ***Default value:*** `true` <br> ***Possible value:*** `true` and `false` | `restart` | This restarts your Mirror with PM2. So make sure the `pm2ProcessName` is right. <br> ***Default value:*** `true` <br> ***Possible values:*** `true` and `false` | `stop` | This stops your Mirror with PM2. So make sure the `pm2ProcessName` is right. <br> ***Default value:*** `true` <br> ***Possible values:*** `true` and `false` | `reboot` | This reboots your Pi. <br> ***Default value:*** `false` <br> ***Possible values:*** `true` and `false` | `shutdown` | This shutdowns your Pi. ***Note:*** When you shutdown the Pi your devices aren't available. So you must start your Pi manually. <br> ***Default value:*** `false` <br> ***Possible values:*** `true` and `false` | `monitorToggle` | This can switch your monitor on and off. Make sure the used command work for you. Look at the option `vcgencmd` <br> ***Default value:*** `true` <br> ***Possible values:*** `true` and `false`
devices not found
1. Devices not found: <br> * Make sure that your Alexa and Pi are in the same Wifi. I had also the problem that my Pi was in the 2.4GHz Wifi and my Alexa in the 5GHz Wifi. It's only a problem when you discover the devices. To solve the problem disable one of the Wifis for a moment or turn the Wifi on your Pi on and off till it works. * Have you used the port before? Try every devices from the mirror. Probably the name is wrong. If that happen delete the device and discover for new devices. Define yourself ports for notification and custom devices to prevent this problem.
NOT in the readme
the startPort MUST BE different for each MagicMirror device
the discovery records the ip address and port for each device, when an action is required, alexa send a web request to that ip and port. (which the module handles)
-
@sdetweil thank you for the help btw!!!
ok i figured out that my tv which i use as the display (Samsung LE-32 C530) has HDMI-CEC so i tried it with that and it works after i installed the cec module.
its just a shame that the tv needs 15 seconds to boot (EVERYTIME!!) and i cant disable the pop up on start which shows the source and the hdmi port used.How can i stop the standby mode for the raspberry pi? because if the screen is off for a certain time and i turn it on again it shows me a blank black screen until i press a button or mouve the mouse (which i don want to have connected later on).
How can i make the mirror to autostart on booting the raspberry?
I have no shutdown command. Can i safley turn off the pi with this? and if yes, how do i get it?
I really wanna make this thing work perfectly. i even thinking of adding an ir frame to make it touchscreen =)
-
@Michael-Schw if you don’t use pm2 you should, it will start at boot… if you didn’t install it with my scripted install, then use the fixuppm2.sh script from here
https://github.com/sdetweil/MagicMirror_scriptsjust cut/paste that one line to run that script.
shutdown and reboot are commands built in to linux
sudo shutdown now (-r | -h, -r means reboot, -h means halt)
sudo reboot , is the same as sudo shutdown -rturn off the pi screen saver, also see my screensaveroff script…
(again if you had run my script as part of install, it would have prompted and done all this for you.
my script is listed in the alternative install section of the MM doc)…none of my tvs support cec, so I created my own module for sleep (using a webcam for wakeup), it just hides all the modules,
alexaControl supports that too (vgencmd:‘hide’)
MMM-SleepWakemy pis & tvs run 24x7
-
@sdetweil thank you…you are a genius😁
I installed that automated update now but how do i excactly turn the screensaver off…i cant find your script…do you have a link for that?
And how can i start the mirror automaticly on boot of the raspberry? And is there any posibillity that the pi reboots itself if he needs it or should i just say it sometimes to alexa? Because if i let it run 24/7 it will at some time become really slow i think.
So what do i have to add in the option pm2processname for the alexa module?
Because refresh and monitor toggle are working but stop and restart isnt.
And i dont have shutdown at my alexa devices for the mirror. -
@Michael-Schw i’m sorry, I do not understand…
you do NOT ‘install’ anything from my scripts repo. you just execute the commands I have documented.
to turn off the screensaver you copy/paste this one line to a terminal window on the pi
bash -c "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/screensaveroff.sh)"
to setup for start at boot, you run the pm2 script, the same way
bash -c "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/fixuppm2.sh)"
then you can also stop/restart the process
pm2 status will tell u it anything is runningpm2 start number| name
will start that named processpm2 restart, stop, show, list, are other commands
pm2 logs --lines=?? will show the terminal window output of the processes (?? is a number)
pm2 --help will give u the syntax
the alexaControl module needs the NAME of the pm2 process definition
pm2 status ┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐ │ id │ name │ mode │ ↺ │ status │ cpu │ memory │ ├────┼────────────────────┼──────────┼──────┼───────────┼──────────┼──────────┤ │ 0 │ MagicMirror │ fork │ 8 │ stopped │ 0% │ 0b │ │ 1 │ smart-mirror │ fork │ 35 │ stopped │ 0% │ 0b │ └────┴────────────────────┴──────────┴──────┴───────────┴──────────┴──────────┘
so for MM it would be whatever is listed for the name
to change the name, u need to delete the entry (see the pm2 help for the syntax here)
and create it again, after modifying the ~/MagicMirror/installers/pm2_MagicMirror.json filethen rerun my fixuppm2.sh script again.
the devices added by AlexaControl are defined in the translations/??.json file, here is the default en.json
{ "PAGE": "page ", "REFRESH": "refresh", "RESTART": "restart pm2", "STOP": "stop pm2", "REBOOT": "reboot pi", "SHUTDOWN": "shutdown pi", "MONITOR": "monitor", "USB": "USB" }
so the devices are
"refresh", "restart pm2", "stop pm2", "reboot pi", "shutdown pi", "monitor"
remember these are electric outlet type devices, they can be on or off… that is all
so the alexa voice syntax is
alexa turn on (or off) device
alexa turn on refresh
alexa turn off monitor
alexa turn on restart pm2etc