Get Auth and credentials to make profile.

  1. Create a project in the Actions Console

Follow this step

  • New Project 
  • Agree and Continue 
  • Create project 
  1. 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 and Library
  • API Library search
  • Google Asssitant API search
  • Enable Google Assistant API
  • Wait for activation
  1. Return to Actions Console and Follow this instructions to register a device model
  1. 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 select External.
  • Select you email adress
  • Save it
  1. you have download your credentials file (client_secret_XXX.json file) for OAuth and Carefully store it in MMM-GoogleAssistant directory and rename it to credentials.json
cd ~/MagicMirror/modules/MMM-GoogleAssistant
mv client_secret_XXX.json credentials.json
  1. 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 your MMM-GoogleAssistant directory.

Get deviceModelId and deviceInstanceId [Optional]

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.

For deviceModelId

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.

For deviceInstanceId

You need additional google-assistant-sdk library. See Manually Register a Device with the REST API page.

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *