-
Notifications
You must be signed in to change notification settings - Fork 8
Account Setup for GA
This page will show you how to properly setup your Google Account and retrieve the necessary authentication tokens for your Google Assistant.
You need to get a JSON file for OAuth2 permissions.
https://developers.google.com/assistant/sdk/develop/grpc/config-dev-project-and-account
Create a project for MagicMirror. Enable Google Assistant API
and Google Cloud Speech API
.
- Login on https://console.cloud.google.com/cloud-resource-manager
- Select
CREATE PROJECTS
. - Give a project name to this new project.(Google will suggest a unique name. Anyway, the name is not important. set this by anything.) And press
CREATE
Button. - Now you might be in Dashboard of the newly created project. (Or select created project from your project lists)
- Go to
API Overview (API & Services > Dashboard)
from Menu or Cards. - Select
ENABLE APIS AND SERVICES
- Search
Google Assistant API
and dive into. - Press
ENABLE
. - You need to create credentials. Go to https://console.developers.google.com/apis/credentials/oauthclient
- Set the
Configure consent screen
. You need to set onlyProduct name shown to users
. - Select Application Type as
other
and give the name. Now you can get oAuth. - Download your
client-secret-blahblahXXX.json
and rename it assecret.json
. Put that file inMMM-Assistant
directory. - Then execute this on your MagicMirror terminal.(not via SSH)
cd <Your MagicMirror Direcotry>/modules/MMM-Assistant
node google-auth.js
- It will try to open the browser for getting some credential keystring. copy and paste it where the
google-auth.js
prompts. - Now, you can find
token.js
underresources
directory. Keep it safely.
- Back to
API & Services > Dashboard
again. - Select
ENABLE APIS AND SERVICES
- Search
Google Cloud Speech API
and dive into. - Press
ENABLE
. - Select
Create Credentials
andService Account Key
. (It's obvious to be able to usesecret.json
again. For safe, I'll create another key file for Google Cloud Speech) - Set the details (anything for
service account name
,Project>Owner
for Role, anything forservice account id
,JSON
forkey type
. After set, you can download your key file. - It will be used in
config.stt.auth
Tip : You can obtain keyfiles more than one if you can make another account. It could be helpful for saving money. (Google Speech API is very cheap, but not free. It allows you 60 minutes for free per month. But every recognition request is considered as minimum 15 seconds. So exactly 240 requests would be available for free. Additional request will be charged $0.006 per request. Anyway, if you create an account at the first time, about $300 for 1 year will be given freely.)