This repository was archived by the owner on Jul 15, 2025. It is now read-only.
Repository navigation
Example configuration
JoChef2 edited this page Jun 4, 2020
·
7 revisions
Here is an example configuration for the MMM-AlexaControl module. I think then it's easier to understand.
- Open a new terminal.
- Navigate to your modules folder:
cd ~/MagicMirror/modules- Clone this repository:
git clone https://github.com/JoChef2/MMM-AlexaControl.git- Navigate into the module folder:
cd ~/MMM-AlexaControl- Install the necessary node modules. This step could use a few minutes.
npm install- Configure the module in your config file. For that use the next part.
- Open the config file e.g. with Geany. You find the config file in your MagicMirror folder inside the config folder.
- Copy the following part into your config inside the modules array:
{
module: 'MMM-AlexaControl',
position: 'middle_center',
config:{
image: true,
pm2ProcessName: "mm",
monitorToggle: true,
vcgencmd: true
}
}- You need to define the position also if you don't use the image.
- If you want to use the image set
imagetotrue. If not set it tofalse. - If you want to restart your mirror with Alexa you have to define the
pm2ProcessName. If you don't configured PM2 at the time you can use this tutorial. - If you want to turn only your monitor on an off with Alexa you have to set
monitorToggleto true and do the next steps. If not set it tofalseand skip to step seven.
- There are two different commands to toggle the monitor. For me only one worked. So you have to test them.
- Open a SSH connection to this because if the monitor is black you can't turn it on.
- Run the following command:
vcgencmd display_power 0
a. If it works run the command:vcgencmd display_power 1to turn the monitor on and setvcgencmdto"vcgencmd". Then skip to step seven.
b. If it not works run the command :tvservice --off
c. If that works run the command:tvservice --preferredto turn the monitor on and setvcgencmdto"tvservice". Then skip to step seven.
d. If all commands doesn't work for you you have three possibilities.
- Search for a working command and create an issue or pull request. So I can add it.
- Use the module MMM-SleepWake. For that set the option to
"hide"
- You can use cec-client. You can install it with the command
sudo apt-get install cec-utils. Then you should test if it founds a device withcec-client -l. If not you should use one of the other steps. If it works test it with the following commands:echo \'standby 0.0.0.0\' | cec-client -s -d 1. If it doesn't work change the address or use one the other steps. If it works runecho \'on 0.0.0.0\' | cec-client -s -d 1and setvcgencmdto"cec-client". If you changed the address configure thececAddress.
- Search for a working command and create an issue or pull request. So I can add it.
- If you want to use more then one mirror with this module you have to follow these steps:
- Set an individual
deviceNamee.g.deviceName: "bathroom mirror"
- You have to change the
startPort. Every devices has it's own port. If the startPort is set to 11000 the ports 10900 - 11200 are reserved. So for every mirror increase the startPort by 1000. So your second has thestartPort: 12000and so on.
- Set an individual
- If you want to use other modules with this module, look on the other modules page for examples.