Read the statement by Michael Teeuw here.
MMM-AlexaControl or MMM-AlexaOn/Off setup
-
@Michael-Schw said in MMM-AlexaControl or MMM-AlexaOn/Off setup:
[2020-08-10 17:29:59.025] [LOG] Please configure the option vcgencmd
[2020-08-10 17:31:37.427] [LOG] Please configure the option vcgencmd
[2020-08-10 17:31:42.434] [LOG] Please configure the option vcgencmd
[2020-08-10 17:32:02.023] [LOG] Stopping PM2 process: mmdo pm2 status
the name there is the name of the pm2ProcessName: config optionmy config , on mirror system βdeskβ
{ module: "MMM-AlexaControl", disabled: false, position: "bottom_left", config: { deviceName: "desk", image: false, pm2ProcessName: "MagicMirror", vcgencmd: "hide", monitorToggle: true, startPort: 16000, reboot: true, shutdown: true, stop: true, }, },
-
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