Ref. Assistant Relay Installation
- Install node.js version 10.13.0 (using nvm) nvm for window
- Install PM2 by
$ npm i pm2 -g
(using Windows PowerShell) - Install Assistant Relay by download Assistant Relay V3.2.0 release.zip
- Extract the folder and run
$ npm i
inside that folder
- Configure Google Develop Project (step 1 - 6)
- Go to Google Developer Console
- Click on the Credentials link in the left hand menu
- At the top, click the Create Credentials button and select OAuth Client ID
- Select Web Application from the dropdown list
- Give your client ID a name, such as Assistant Relay. Click Create.
- Click the Download button to download your secret_client json file.
- Modify secret_client_xxx.json by changing "web" key to "installed"
- Run
$ npm run start
and open the Assistant Relay webpage on browser
Note: If error occurs, try kill running processTASKKILL /F /IM node.exe /FI "PID gt 0"
(using Windows PowerShell) - Upload secret_client_xxx.json to the webpage, add your user name and click next.
- It will pop up the Google Account linking page, authorize it with your Google Account
- It will now show the blank white page with some text on it. Copy the code in the url
http://localhost/?code=**COPYCODEFROMHERE**&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fassistant-sdk-prototype
Ref. link - Come back to the Assistant Relay webpage, and paste the code.
- The user is added.
Ref. Assistant Relay Command Usage
- Command the device
POST to , for example, http://192.168.1.157:3000/assistant, with the body of raw json format
{
"command": "turn on the fan",
"converse": false,
"user": "earth"
}
Note: When want to command the Device, "converse" must be false.
- Broadcast to Google Home device
{
"command": "hello world",
"broadcast": true,
"user": "earth"
}
- Assistant Relay demo with Postman Youtube link