A step-by-step guide on how to get Google Assistant onto your Magic Mirror!
This is what the Google Assistant looks like when it is not activated.

This is what the Google Assistant looks like when you say "Hey Google" or "Ok Google!"


Make sure you follow all the steps on the menu. Start on the page labeled "set up hardware and network access" and end on the page that says "run the sample code!"


Getting Google Assistant onto your Magic Mirror can be a frustrating task, so here is a step-by step guide on how to do it!
Step 1
The first thing you want to do is set up the Google Assistant in your Raspberry Pi. To do this, you want to run the command
git clone https://github.com/gauravsacc/MMM-GoogleAssistant.git
in the Raspberry Pi terminal. Once that is done, you want to run three more commands in the terminal.
First,
cd MagicMirror
then,
cd modules
lastly,
npm install
Now you are done with the first step!
Step 2
Now you need to register your Google Assistant device! (your raspberry pi)
To do this, you can go to this website and follow all the steps.
On the left side of the web page, you will see a menu that looks like the menu in the image to the left of this paragraph. Make sure you go through all the pages and follow all the steps in order!
Step 3
If you ran the sample code on the last page and it worked, you are ready for step 3. If you run into any errors, view the forums for this module!
Now, we need to create a Pubnub account and install the Pubnub dependencies on our Raspberry Pi!
Create Pubnub Account:
First, sign up for a Pubnub account using this link.
You will receive a link in your email when you sign up. It may be in your spam folder.
When you log in for the first time, you will see a pop up like the one on the left.
Click "other messaging use cases" and then click "start using PubNub"
Then, click on the left arrow next to "demo keyset" which will take you to a page that will say "my first app." Click the left arrow again and you will see a page with a red button that says "create a new app!"
Click that button and it will prompt you to enter an app name. (image on the left) Enter the name "Google Assistant" and then click "other messaging use cases." Then click "create."
You will then be taken to a page that shows two apps. Click on the one named "Google Assistant." Then you will be taken to a similar page. Click the box named "google." You should now see a publish key and a subsciber key. Keep this tab open for later. You are almost done!
Install Pubnub Depenencies:
Now you will need to install the pubnub dependencies on your Raspberry Pi. To do this, enter the command below in your Raspberry Pi terminal.
pip install 'pubnub>=4.0.13'
You are now done with step 3!
Step 4

Now you need to configure the assistant.py file on your Raspberry Pi.
First, go into file explorer on your raspberry pi. Then click on the Magic Mirror folder. Then click on the modules folder. Then click on the pi folder. You should see a file named "assistant.py." Right click on the file and click "open in Geany."
Scroll down and you should see a section that looks like the image on the left. There should be two lines where it is SUBSCRIBE-KEY and PUBLISH-KEY. Replace those sections in the quotation marks with the subscriber and publish keys in the Pubnub tap you had left open. Then do Crtl-S or press save. Then close Geany.
Next, open terminal on your Raspberry Pi. Then enter the following commands.
First,
cd MagicMirror
then,
cd modules
next,
cd MMM-GoogleAssistant
then,
cd pi
lastly,
python assistant.py
Once you do all of those commands, it should say "Pubnub subscription completed" and "hello from python." If you do not see this, go into the fourms that were linked in step 3 to find a solution. Now you are done with step 4!
Step 4


Now, all you need to do is add the config text into the Magic Mirror config file on your Raspberry Pi.
Go onto file explorer on your Raspberry Pi and click on the folder named Magic Mirror. Then click on the folder named config. Then you should see a file named config.js. Right click on it and click "open in Geany." Scroll down and put your cursor next to one of the paranthesees with a comma next to it. Then click enter. It should look like the image on the left.
Now go on this website and scroll down untill you see a heading named "add to config.js." Copy the code unter the heading and paste it where your cursor is in Geany. Then replace the text that says PUBLISH KEY with your publish key and replace the text that says SUBSCRIBER KEY with your subscribe key from Pubnub.
It should look like the image on the left. (press tab untill it looks correct)
Step 5
You are done!
All you need to do is launch your magic mirror!
Note: Every time you want to start your Google Assistant, you have to run all the commands in step 4 in order. When you run the commands, keep the terminal open. If you close the terminal, the Google Assistant will not work. :)