This is a module for voice controlling a lot of elements of MagicMirror. It works as an offline voice controller where the MagicMirror does not need to be connected to Internet for VoiceCommander to work. Also, if you need a HOTWORD module to activate other online modules - this is it! It can activate either Alexa and Google Assistant using specific modules already available.
-
Used as hotword only to activate either Google Assistant or Amazon Alexa
-
Used as hotword to activate both Google Assistant and Amazon running at the same time
-
Control other modules that use voice commands with a single microphone
-
Built in
Motion Detection
for webcams to activate/de-activate upon motion/timout -
Use hand gesture to mute/resume sound (to issue new voice commands if speaker is busy - requires webcam)
-
Take Selfies! (requires webcam)
-
Built in support for custom sound files
-
Hide and show pages of modules
-
Hide and show individual modules - No modification of other modules necessary!
-
Offline by default - no need for internet to issue commands
-
Add your own sentences and custom commands
(**TODO**: Create instruction for json files)
-
Here you will find the webcam module
Hardware Platform | Operating System | Notes |
---|---|---|
HP Elite 8300 | ✔ Ubuntu 18.04 LTS | - |
HP Elite HPEu | ✔ Ubuntu 16.04 LTS | - |
HP G60 Laptop | ✔ Ubuntu 18.04 LTS | - |
Huawei Matebook Pro | ✔ Ubuntu 16.04 LTS | - |
Intel NUC Celeron | ✔ Ubuntu 16.04 LTS | - |
Tinker Board S | ✔ TinkerOS 2.0.8 | - |
Raspberry Pi 3b+ | ✔ Debian Stretch | - |
Odroid | ✘ | Need somebody to test on Odroid! |
Windows | ✘ | Need somebody to test on Windows! |
- USB Logitech C920
- Several integrated laptop cams
Start by doing the commands below to make the initial installation:
Perform the commands from ~/MagicMirror/modules directory
git clone https://github.com/thestigh/MMM-VoiceCommander
cd MMM-VoiceCommander
cd installers
bash dependencies.sh
After installation you need to check your audio setup, as this module also relies on arecord/aplay. From your home directory, run command:
sudo nano ~/.asoundrc
If it is empty, copy following code to the editor (values might need to be changed):
pcm.!default{
type asym
playback.pcm{
type plug
slave.pcm "hw:0,0"
}
capture.pcm{
type plug
slave.pcm "hw:0, 0"
}
}
ctl.!default{
type hw
card 0
}
Do you want help to confiure or just deeper understanding arecord, click here
Then make sure you set the hw: and the card vales according to your own hardware configuration (you get the output at the end of installerscript you just ran) where hw:0,0 representt output and hw:1,0 represent input source. Or you can run the command over again to see the outputs by running cat /proc/asound/cards
Save and close nano editor
{
disabled: false,
module: "MMM-VoiceCommander",
position: "top_center",
config: {
timeout: 10, // timeout listening for a command/sentence
defaultOnStartup: 'MMM-VoiceCommander', // keep this so this module always are present on MM
keyword: 'HELLO LUCY', // keyword to activate listening for a command/sentence
debug: false, // get debug information in console
standByMethod: 'DPMS', // 'DPMS' = anything else than RPi or 'PI'
sounds: ["female_hi.wav"], // welcomesound at startup, add several for a random choice of welcome sound
startHideAll: true, // if true, all modules start as hidden
microphone: 'default', // Do NOT change, is read from ~/.asoundrc
speed: 1000, // transition speed between show/no-show/show in milliseconds
activateMotion: false, // if true, webcam will be used to activate/deactivate MM on movement
onlyHotword: false, // TBA - Hotword only to activate external module by sendNotification
onOnlyHotword: 'AMAZON', // If onlyHotword, what Assistant to start, 'GOOGLE' or 'AMAZON'
timeoutSeconds: 10, // seconds to wait for external module to confirm control of mic
captureIntervalTime: 1000, // how often should the webcam check for motion, in milliseconds
scoreThreshold: 20, // threshold to assume motion/no-motion -> se console log for score
timeoutMotion: 120000, // timeout with no motion until sleep monitor, in milliseconds
muteThreshold: 2000, // motion level to activate mute of speaker
muteVolumeLevel: 1, // what volume level to set speaker on activated mute
muteNormalLevel: 50, // set normal volume level on startup
muteTimer: 10000, // how long in milliseconds to mute the speaker
mainPageModules: ["MMM-VoiceCommander"], // default modules to show on page one/startup
pageTwoModules: [], // modules to show on page two
pageThreeModules: [], // modules to show on page two
pageFourModules: [], // modules to show on page two
pageFiveModules: [], // modules to show on page two
pageSixModules: [], // modules to show on page two
pageSevenModules: [], // modules to show on page two
pageEightModules: [], // modules to show on page two
pageNineModules: [], // modules to show on page two
pageTenModules: [] // modules to show on page two
},
- Hello Lucy (Replace Hello Lucy with your keyword)
- Go Assistant - relies on MMM-AssistantMk2
- Go Amazon - relies on MMM-Alexa
- Show Assistant
- Hide Assistant
- Show Alexa
- Hide Alexa
- Go To Sleep
- Please Wake Up
- Open help
- Close help
- Show Main Page
- Show Page Two
- Show Page Three
- Show Page Four
- Show Page Five
- Show Page Six
- Show Page Seven
- Show Page Eight
- Show Page Nine
- Show Page Ten
- Show Modules
- Hide Modules
- Show Camera - relies on (https://github.com/alexyak/camera)
- Hide Camera - relies on (https://github.com/alexyak/camera)
- Selfie - relies on (https://github.com/alexyak/camera)
FOLLOWING REQUIRES INSTALLATION OF MMM-WindyV2
- Hide Wind
- Show Wind
- Zoom In
- Zoom Out
- Show Default Zoom
- Show Me Wind
- Show Me Rain
- Show Me Clouds
- Show Me Temperature
- Show Me Pressure
- Show Me Currents
- Show Me Waves
- Rotate Layer
- Play Animation
- Cancel Animation
CONTROL Google Assistant MMM-AssistantMk2
Click here for the repo and documentation.
CONTROL Amazon Alexa MMM-Alexa
Click here for the repo and documentation.
- MMM-AfterShip - Hide/Show Shipping
- MMM-ATM - Hide/Show Trivia
- MMM-BMW-DS - Hide/Show Weather
- MMM-CARDS - Hide/Show Cards
- MMM-Census - Hide/Show Census
- MMM-Cocktails - Hide/Show Cocktails
- MMM-EARTH - Hide/Show Earth
- MMM-EarthWinds - Hide/Show EarthWind
- MMM-EasyBack - Hide/Show Background
- MMM-EasyPix - Hide/Show Lucy
- MMM-Events - Hide/Show Events
- MMM-EventHorizon - Hide/Show Timer
- MMM-EyeCandy - Hide/Show EyeCandy
- MMM-FMI - Hide/Show Phone
- MMM-Fortune - Hide/Show Fortune
- MMM-Gas - Hide/Show Gas
- MMM-ISS - Hide/Show Station
- MMM-JEOPARDY - Hide/Show Jeopardy
- MMM-LICE - Hide/Show Lice
- MMM-Lottery - Hide/Show Lottery
- MMM-Lunartic - Hide/Show Moon
- MMM-MARS - Hide/Show Mars
- MMM-NASA - Hide/Show Nasa
- MMM-NOAA3 - Hide/Show Weather
- MMM-PC-Stats - Hide/Show Stats
- MMM-PetFinder - Hide/Show Pets
- MMM-PilotWX - Hide/Show Pilots
- MMM-SORT - Hide/Show Tides
- MMM-SoundMachine - Hide/Show SoundMachine
- MMM-SunRiseSet - Hide/Show Sunrise
- MMM-ToDoLive - Hide/Show Reminder
- MMM-History - Hide/Show History
- MMM-Astro - Hide/Show Horoscope
- MMM-DailyQuotes - Hide/Show Quote
- MMM-Glock - Hide/Show Glock
- calendar - Hide/Show Calendar
- clock - Hide/Show Clock
- compliments - Hide/Show Compliments
- currentweather - Hide/Show Current
- newsfeed - Hide/Show Newsfeed
- weatherforecast - Hide/Show Forecast
- Simply post your request in the MMM-VoiceCommander 'issues'
- Name the module and the custom command you would like
Accessing your (web)cam requires to have the client run on localhost or a HTTPS host. This is due to new requirements in Chrome for 'getUserMedia'. The default value in your MagicMirror config.js is already localhost so most users shouldn't be affected.
- MMM-voice by Strawberry 3.141
- motiondetector, camera by alexyak
- Hello-Lucy by Mykle1
@sdetweil added crucial microphone release functionality to the module
@Mykle1's original pages and hide/show commands were improved upon and custom sound support
@cowboysdude for his array magic and Skype consultations