Google Assistant library for webOS OSE Refer to the Assistant SDK documentation for more information.
- Create google account. Configure a developer project and account Settings. following these instructions
- Go to the Actions Console and register your device model. following these instructions
Please ensure all of that instructions.
Create project, Enable api, Register device model, set activity control and download credentials json file etc.
- Download OAuth-2.0 Client ID credentials file and move it to
/etc/googleAssistant/client_secret.jsonon your device via scp.
On your local pc
$ scp <downloaded json file> root@<your device ip>:/etc/googleAssistant/client_secret.json
On your device
$ cd /etc/googleAssistant
$ ./get_credentials.shInput the code from showed url then It will create the credentials.json file.
$ cd /etc/googleAssistant
$ vi ./device_id.jsonModify id(device instance string. eg. my_webos) and model_id(registered by step #1) fields in device_id.json
$ ./register_device_id.shIt will register your device id
If you receive an error during device registration, you have to enable the Google Assistant API at link that given from response.
Below is an error message.
{
"error": {
"code": 403,
"message": "Google Assistant API has not been used in project <project No> before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/embeddedassistant.googleapis.com/overview?project=<project No> then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"status": "PERMISSION_DENIED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"description": "Google developers console API activation",
"url": "https://console.developers.google.com/apis/api/embeddedassistant.googleapis.com/overview?project=<project No>"
}
]
}
]
}
}$ vi /var/systemd/system/env/ai.envModify GOOGLEAI_DEVICE_MODEL(registered by step #1) and GOOGLEAI_DEVICE_ID(registered by step #2)
$ rebootor
$ systemctl restart aiRefer README.md of com.webos.service.ai
Google assistant supports custom device actions
Refer the /etc/googleAssistant/action.en.json
You can download gactions CLI tool