Get Auth and credentials to make profile.
- Create a project in the Actions Console
Follow this step
- New Project
- Agree and Continue
- Create project
- After creation, Enable
Google Assistant API
for your project in the Cloud Platform Console
Follow this step
- Agree and Continue
- Select your project and note your
Project ID
name
- In the left menu select
APIs & Services
andLibrary
- API Library search
- Google Asssitant API search
- Enable Google Assistant API
- Wait for activation
- Return to Actions Console and Follow this instructions to register a device model
- You can use this URL https://console.actions.google.com/u/0/project/[yourprojectId]/deviceregistration/ (change [] to your Project ID)
- Register Model as TV
- Download credentials
- Optional (Maybe for a future version Of GoogleAssistant)
- If needed, you can find again your credentials from Cloud Platform Console (Your Project > APIs & Services > Credentials)
OAuth Consent Screen
setup
- Go to Cloud Platform Console, then navigate to
APIs & Services > OAuth Consent Screen
. At first, you’ll be asked which user type would use your project. Just selectExternal
.
- Select you email adress
- Save it
- you have download your credentials file (
client_secret_XXX.json
file) for OAuth and Carefully store it inMMM-GoogleAssistant
directory and rename it tocredentials.json
cd ~/MagicMirror/modules/MMM-GoogleAssistant
mv client_secret_XXX.json credentials.json
- In your SBC, you can run auth-tool for auth. (not via SSH)
cd ~/MagicMirror/modules/MMM-GoogleAssistant
node auth_and_test.js
- At first execution, this script will try opening a browser and getting permission of a specific user for using this Assistant. (So you’d better to execute this script in your RPI shell, not via SSH)
- After confirmation, Some code (
4/ABCD1234XXXXX....
) will appear in the browser.
- Copy that code and paste in your console’s request (
Paste your code:
)
- On success, Prompt
Type your request
will be displayed. Type anything for testing assistant. (e.g:Hello
)
- Now you can find
token.json
in yourMMM-GoogleAssistant
directory.
deviceModelId
and deviceInstanceId
[Optional]
Get If you are not an experienced developer or don’t need
gactions
implements, pass this section.
If you want not only pure Assistant embeding but also customized gactions for device, you might need to get deviceModelId
and deviceInstanceId
. To help understanding, deviceModel is something like Volkswagen Golf
or MagicMirror
and deviceInstance is something like mom's car
or mirror in living room
.
deviceModelId
For You can get deviceModelId
as a result of previous register a device model step. In Device registration
menu in Actions Console
, you can find it.
deviceInstanceId
For You need additional google-assistant-sdk
library. See Manually Register a Device with the REST API page.