Configure a Developer Project and Account Settings
Configure an Actions Console project
A Google Cloud Platform project, managed by the Actions Console, gives your device access to the Google Assistant API. The project tracks quota usage and gives you valuable metrics for the requests made from your device.
To enable access to the Google Assistant API, do the following:
- Open the Actions Console.
- GO TO THE ACTIONS CONSOLE
- Click on Add/import project.
- To create a new project, type a name in the Project name box and click CREATE PROJECT.
- If you already have an existing Google Cloud Platform project, you can select that project and import it instead.
- Click the Device registration box.
- Enable the Google Assistant API by accessing to your google cloud panel
- Choose yourproject (see the Terms of Service).
- On left Panel Go toAPis And Services
- Library
- Search for “Assistant”
- Enable The API
- ENABLE THE API
- Click Enable.
Set activity controls for your account
In order to use the Google Assistant, you must share certain activity data with Google. The Google Assistant needs this data to function properly; this is not specific to the SDK.
Open the Activity Controls page for the Google account that you want to use with the Assistant. You can use any Google account, it does not need to be your developer account.
Ensure the following toggle switches are enabled (blue):
- Web & App Activity
- In addition, be sure to select the Include Chrome browsing history and activity from websites and apps that use Google services checkbox.
- Device Information
- Voice & Audio Activity
Register the Device Model
In order for the Google Assistant to respond to commands appropriate to your device and the given context, the Assistant needs information about your particular device. You provide this information, which includes fields like device type and manufacturer, as a device model. You can think of this model as a general class of device - like a light, speaker, or toy robot.
This information is then accessible to the Google Assistant and is associated with your Actions Console project. No other projects have access to your model and device information.
Use the registration UI
Use the registration UI in the Actions Console to register a device model.
- Open the Actions Console.
- Select the project you created previously.
- Select the Device registration tab (under ADVANCED OPTIONS) from the left navbar.
- Click the REGISTER MODEL button.
Create model
- Fill out all of the fields for your device.
- See the device model JSON reference for more information on these fields.
- When you are finished, click REGISTER MODEL.
Download credentials file
The credentials.json file must be located on the device. Later, you will run an authorization tool and reference this file in order to authorize the Google Assistant SDK sample to make Google Assistant queries. Do not rename this file.
Download this file and transfer it to the device. Click NEXT.
For the Raspberry Pi only:
Make sure this file is located in /home/pi. If you want to upload the file to the device, do the following:
- Open a new terminal window. Run the following command in this new terminal:
- Note: Do not run the following command in an SSH session connected to the device. This command transfers the JSON file from a directory on your development machine to the device. An SSH session cannot access your local directories.
- scp ~/Downloads/credentials.json pi@raspberry-pi-ip-address:/home/pi/
- password: password-for-device
- Close this terminal window.
Specify traits
Later, you will specify the different abilities that your device supports on this screen. But for now, click the SKIP button.
Edit the model
If you need to edit the model, click its row in the list. Make sure to click SAVE after any edits.
To download the credentials file again, click the ellipses. You can delete the model from this menu as well.
Generate credentials
Open Terminal in Raspbian
- google-oauthlib-tool --scope https://www.googleapis.com/auth/assistant-sdk-prototype \
--scope https://www.googleapis.com/auth/gcm \
--save --headless --client-secrets /home/pi/credentials.json - You should see a URL displayed in the terminal:
- Please visit this URL to authorize this application: https://...
- Copy the URL and paste it into a browser (this can be done on any machine). The page will ask you to sign in to your Google account. Sign into the Google account that created the developer project in the previous step.
- Note: To use other accounts, first add those accounts to your Actions Console project as Owners.
- After you approve the permission request from the API, a code will appear in your browser, such as "4/XXXX". Copy and paste this code into the terminal:
- Enter the authorization code:
- If authorization was successful, you will see a response similar to the following:
- credentials saved: /path/to/.config/google-oauthlib-tool/credentials.json
- If instead you see InvalidGrantError, then an invalid code was entered. Try again, taking care to copy and paste the entire code.
Restart and Enjoy with GA in Qbo
Hi, me again, I was able to follow each step. I'm trying to interact with my google assistant 8in italian) but it doesn't work.
Is it because my assistant is in italian?
Another discrepancy from your process is that I transeferred the credentials file to q.bo using google drive instead of the comand line you suggested, since my only connection to q.bo is the internet via VNC.
Last discrepancy is the credentials file name: mine is client_secret_859351963768-5ltjf9bauoch51b0pa7m65defbdjd9b1.apps.googleusercontent.com.json as it was genereted out of the credentials generator.
Any suggestion? my google assistant can understand also english, not only italian... at least on my mobile.
Just as additional information, I see that in the new q.bo config box, you put also a GAssistant token field, with also a checkbox named "enable questions. I did not touch anything there, since there is no instruction about in the thread above. Should I?
Just as additional information, I see that in the new q.bo config box, you put also a GAssistant token field, with also a checkbox named "enable questions. I did not touch anything there, since there is no instruction about in the thread above. Should I?
Hello Giancarlo,
about your questions:
1.- You can connect a Keyboard & Mouse in order to transfer the "credentials" to your robot, also you can use SSH for the same task.
2.- The GA SDK for "third devices" like Q.bo and other non official project only works in English but Google is working to extend to other languages very soon.
Kind regards.
Got your suggestions, thank you! I was too audacious trying italian... I will switch to english...
Thanks and regards
Me again, I changed language, I did all the authorization steps and got final confirmation.
I also changed the google assistant I would like to you with q.bo (the same on my mobile) to english language in order to see how it responds on q.bo and on my mobile.
Unfortunately with q.bo I can only receive answer for "hellO" and "how are you", while obviously on my mobile I get answers also for "1+1=" or "please generate a random number" or...
Is there anything I can test with q.bo that you already know is working with google assistant? So I can understand if it works or not...
Hi Giancarlo,
maybe something is wrong with your installation. You will change the QBO desktop file to start with GA instead Dialogflow?
You can receive answers like your GA mobile version. You could ask about weather, mathematics, the same like a mobile version.
KInd regards,
Hello, it was indeed still on Diagflow! It was not in the instructions, I didn't change it...
Now it works great with the assistant! I put as as token the Project id.
Something special I have to test for you?
Hi
I'm having issues with the authorization token, when I copy the URL provided by the google-oauthlib-tool to the browser iand I select the account my Actions console is connected to I only get a "Something went wrong" message, sometimes an error 500. I don't know if this is an issue on the Google side or in the command format. I have noticed the gcm service is being deprecated in favor of the fcm.
Yes, the Google gcm service is being deprecated in favor of the fcm but the GA is working well and very fast. We will try to simulate your issue in our laboratory.
Hi,
I am trying to install the GA on my Q.Bo. At the last set of steps; Generate Credentials; using the terminal on the Q.Bo raspberry Pi; I receive an error at the first step: bash: google-oauthlib-tool: Command Not Found.
Is there some update or install I need to do first? All previous steps int he above procedure have worked fine.
Thanks,
Did you "activate" your API into your google account?
Please clarify how to "activate" the API into my Google account, thus generating a key that I can enter in the ConfigQBO UI under "GAssistant Token". Note, that I unsuccessfully tried the existing API keys created by Google ("Browser key" and "Server key") and I even created/tried a new API key, created with "Create credentials". Please help - I really got excited when I saw the Blog video :)
Enable the Google Assistant API on the project you selected. You need to do this in the Cloud Platform Console.
Click Enable.