google-home / smart-home-nodejs

A sample of the Smart Home device control APIs in Actions on Google
Apache License 2.0
892 stars 291 forks source link

Errors after setting up locally #492

Open antonio-fiol opened 4 years ago

antonio-fiol commented 4 years ago

I was seeing weird behavior, but managed to add a device. When trying to repeat the steps to document the issue, here is how it goes.

It seems that it starts correctly...

$ npm run start:local

> smart-home-app-sample@0.0.1 start:local /home/user/smart-home-nodejs
> node dist/index.js isLocal

Smart home server listening at :::3000

COPY & PASTE NGROK URL BELOW
https://70432596.ngrok.io

=====
Visit the Actions on Google console at http://console.actions.google.com
Replace the webhook URL in the Actions section with:
    https://70432596.ngrok.io/smarthome

In the console, set the Authorization URL to:
    https://70432596.ngrok.io/fakeauth

Then set the Token URL to:
    https://70432596.ngrok.io/faketoken

Finally press the 'TEST DRAFT' button

Then I change the URL in index.html and start the front-end, point my browser to it, and this appears on the log:

{ userId: '1234', deviceId: '1rg', localDeviceId: null }
{ userId: '1234', deviceId: '1rg', localDeviceId: null }
{
  "error": {
    "code": 429,
    "message": "Resource has been exhausted (e.g. check quota).",
    "status": "RESOURCE_EXHAUSTED"
  }
}

POST /smarthome/update 400 7344.313 ms - 162
{
  "error": {
    "code": 404,
    "message": "Requested entity was not found.",
    "status": "NOT_FOUND"
  }
}
Fleker commented 4 years ago

Have you linked your account to the Google Assistant?

antonio-fiol commented 4 years ago

I didn't even get to that point. I got stuck on steps 1-2 here: Setup sample service [...]

  1. Open the web portal URL.
  2. Configure the virtual devices shown as you please. Click the cloud icon shown above at least one of them to enable it for cloud control.

I'm trying to configure the virtual devices, but as soon as I open the web portal URL, that appears on the log.

I didn't even get to "Start Testing" or "Set up Account linking".

Fleker commented 4 years ago

You will see a 404 error before you do account linking, as it will try to call HomeGraph APIs, which will fail.

The error is benign.

marmiky commented 4 years ago

Same problem for me. At last i found my test app on Google Home app! Thank you so much for solution!!!!

proppy commented 3 years ago

Do you still have issue deploying the sample?