This is my config for MagicMirror (Original source from Magic Miror Offcial Website: https://magicmirror.builders/)
Install the Magic Mirror using a script on the Internet
sudo apt-get install npm
sudo npm install -g npm@latest
bash -c "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/raspberry.sh)"
After that, using automatic installation method
cd ~/MagicMirror/modules
git clone https://github.com/bugsounet/MMM-Hotword.git
cd MMM-Hotword
npm install
After that, using automatic installation method
cd ~/MagicMirror/modules/
cd modules
git clone https://github.com/bugsounet/MMM-AssistantMk2
cd MMM-AssistantMk2
npm install
After that, using automatic installation method
- Go to Google Action Console and create a new project
https://console.actions.google.com
- Open the Google Cloud Platform Console and select the generated project
https://console.cloud.google.com
- Search for the Google Assistant API and click Enable.
- Click CONFIGURE ... of Credentials and put the name and e-mail.
- Generate Other credentials with the OAuth Client ID in Create Credentials
- Download generated OAuth client ID in json format
- Move the downloaded OAuth client ID to MagicMirror and rename it to credentials.json /module/MMM-AssistantMk2/
mv ~/Download/cre.... credentials.json
- From the local command line in Hardware, run auth_and_test.js to verify the generated client ID
cd /MagicMirror/modules/MMM-AssistantMk2
node auth_and_test.js
- The local browser will display follow it to accept the client verification process to generate the key
- Copy the key and paste to the local command line
- Move the generated token.json
mv token.json ./profiles/default.json
- From the remote or local access to the MagicMirorr config file at /MagicMirror/config/config.js
- Edit the config.js
{
module: "MMM-Hotword",
position: "top_right",
config: {
useDisplay: false,
chimeOnFinish: null,
recipes: ["with-AMk2v3_smart-mirror.js"],
mic: {
recordProgram: "arecord",
device: "plughw:1,0"
},
models: [
{
hotwords : "smart_mirror",
file : "smart_mirror.umdl",
sensitivity : "0.5",
},
],
commands: {
}
}
},
{
module: "MMM-AssistantMk2",
position: "top_right",
config: {
debug: false,
ui: "Fullscreen", // Classic2 or Classic
// if you want Google Home ui style
// set Fullscreen ui AND fullscreen_above position
assistantConfig: {
projectId: "", // Required to use gaction.
modelId: "", // (OPTIONAL for gaction)
instanceId: "", // (OPTIONAL for gaction)
latitude: your_lat, // -90.0 - +90.0
longitude: your_long, // -180.0 - +180.0
},
responseConfig: {
useHTML5: true, // sound render by HTML5
useScreenOutput: true,
useAudioOutput: true,
useChime: true,
timer: 5000,
myMagicWord: false,
//Your prefer sound play program.
//By example, if you are running this on OSX, `afplay` could be available.
//by default mpg321 play program is enabled
//if audio output cutting try with mpg123 or cvlc program
playProgram: "mpg321",
chime: {
beep: "beep.mp3",
error: "error.mp3",
continue: "continue.mp3",
open: "Google_beep_open.mp3",
close: "Google_beep_close.mp3",
},
// false - animated icons, 'standby' - static icons only for standby state, true - all static icons
useStaticIcons: false
},
micConfig: { // put there configuration generated by auto-installer
recorder: "arecord",
device: "plughw:1,0",
},
customActionConfig: {
autoMakeAction: false,
autoUpdateAction: false, // in RPI, gaction CLI might have some trouble.(current version should be 2.2.4, but for linux-arm, Google haven't updated) so leave this as false in RPI. I don't know it is solved or not.
actionLocale: "en-US", // At this moment, multi-languages are not supported, sorry. Someday I'll work.
},
recipes: [ "with-MMM-Hotword.js", "with-MMM-TelegramBot.js" ],
profiles: {
"default": {
profileFile: "default.json",
lang: "vi"
}
},
useA2D: false,
},
},
]
};
- From the remote or local access to the command line of the box
cd /MagicMirror/
DISPLAY=:0 npm start
- Using Hotword "smart-mirror" to wakeup MM MK2 and test