Account Setup for GA - eouia/MMM-Assistant GitHub Wiki
Setting up your Google Accounts
:warning: WIP
This page will show you how to properly setup your Google Account and retrieve the necessary authentication tokens for your Google Assistant.
Step 3. Requirements.
3-1) Auth for Google Assistant & Cloud Speech
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.
detailed steps for Google Assistant 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
CREATEButton. - 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 APIand 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
otherand give the name. Now you can get oAuth. - Download your
client-secret-blahblahXXX.jsonand rename it assecret.json. Put that file inMMM-Assistantdirectory. - 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.jsprompts. - Now, you can find
token.jsunderresourcesdirectory. Keep it safely.
detailed steps for Google Cloud Speech API
- Back to
API & Services > Dashboardagain. - Select
ENABLE APIS AND SERVICES - Search
Google Cloud Speech APIand dive into. - Press
ENABLE. - Select
Create CredentialsandService Account Key. (It's obvious to be able to usesecret.jsonagain. For safe, I'll create another key file for Google Cloud Speech) - Set the details (anything for
service account name,Project>Ownerfor Role, anything forservice account id,JSONforkey 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.)