Skip to content
This repository was archived by the owner on Jul 15, 2025. It is now read-only.

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.

Content

Installation
Configuration

Installation

  1. Open a new terminal.
  2. Navigate to your modules folder:
cd ~/MagicMirror/modules
  1. Clone this repository:
git clone https://github.com/JoChef2/MMM-AlexaControl.git
  1. Navigate into the module folder:
cd ~/MMM-AlexaControl
  1. Install the necessary node modules. This step could use a few minutes.
npm install
  1. Configure the module in your config file. For that use the next part.

Configuration

  1. Open the config file e.g. with Geany. You find the config file in your MagicMirror folder inside the config folder.
  2. 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
        }
    }
  1. You need to define the position also if you don't use the image.
  2. If you want to use the image set image to true. If not set it to false.
  3. 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.
  4. If you want to turn only your monitor on an off with Alexa you have to set monitorToggle to true and do the next steps. If not set it to false and skip to step seven.
    1. There are two different commands to toggle the monitor. For me only one worked. So you have to test them.
    2. Open a SSH connection to this because if the monitor is black you can't turn it on.
    3. Run the following command: vcgencmd display_power 0
      a. If it works run the command: vcgencmd display_power 1 to turn the monitor on and set vcgencmd to "vcgencmd". Then skip to step seven.
      b. If it not works run the command : tvservice --off
      c. If that works run the command: tvservice --preferred to turn the monitor on and set vcgencmd to "tvservice". Then skip to step seven.
      d. If all commands doesn't work for you you have three possibilities.
      1. Search for a working command and create an issue or pull request. So I can add it.
      2. Use the module MMM-SleepWake. For that set the option to "hide"
      3. 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 with cec-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 run echo \'on 0.0.0.0\' | cec-client -s -d 1 and set vcgencmd to "cec-client". If you changed the address configure the cecAddress.
  5. If you want to use more then one mirror with this module you have to follow these steps:
    1. Set an individual deviceName e.g. deviceName: "bathroom mirror"
    2. 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 the startPort: 12000 and so on.
  6. If you want to use other modules with this module, look on the other modules page for examples.

Clone this wiki locally