google-home / smart-home-nodejs

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

Still cannot get this sample running. #50

Closed GermanBluefox closed 6 years ago

GermanBluefox commented 6 years ago

I modified this example to support https and changed action.json to:

  "actions": [{
    "name": "actions.devices",
    "deviceControl": {
    },
    "fulfillment": {
      "conversationName": "ioBroker"
    }
  }],
  "conversations": {
    "ioBroker" :
    {
      "name": "ioBroker",
      "url": "https://iobroker.pro:447/smarthome"
    }
  }
}

The name of my action is "ioBroker", the name of project is "iobrokerhome" image

After I start my server I can browse the Devices: image

Then I register the Action with: gactions update --action_package action.json --project iobrokerhome

And no errors. I go to the Google Home App and try to activate this action: image Yes. I took the pronunciation as "house broker", because I have no lack to use IOBroker/IO-Broker/I.O.Broker.

image

and get this "nothing saying" error after I login: image

This is what I see in the console of my server:

GET /service-worker.js 304 1.947 ms - -
POST: /login  { username: 'rick',
  password: 'oldman',
  redirect: '',
  client_id: 'ghome-iobroker',
  redirect_uri: 'https%3A%2F%2Foauth-redirect.googleusercontent.com%2Fr%2Fiobrokerhome',
  state: 'CrwCQUxWM2ROUzRJa1NJTkdBbHByeEp3S2ZIbzhwTldURHY2UFJiQU1sdfsfsfsNHTTdmdUhYaUVUUTNPLWNVQlhhb0hqVk9hWWg1UVZuay1nbWhTWlZhaFBxUkdXQkI0cElTN3l5Uk92R1ZGZmVJclZ1dnEtRTBSa1YwbDdqa1dsdEo5RHhzbGl0b2lfX2hEcVJkLTZZazl4bUk0cnZYZlJ4ckJCUDZjdmtfM2xFMmUtN21TYkRnMkFSSWM4SVNaNmE4RG9lNUJUbTlHWHk3WHZUQW1BdHRhcVU2RnJNQ3h6bHhFWDhodnl1XzY2V3NmN0lQZ1BES2t6MjFqaFc5bml6a3VrNVMxUTRXUldreUwwRFVFei1ndTFDSjhqVkljc1UtT3dya0hBNHVmZ1BlbFByanJGbRIcYXNzaXN0YW50LWhhbmRvZmY6Ly9jb21wbGV0ZSI7aHR0cHM6Ly9vYXV0aC1yZWRpcmVjdC5nb29nbGV1c2VyY29udGVudC5jb20vci9pb2Jyb2tlcmhvbWUqEWRvZ2Fmb3hAZ21haWwuY29tMhBpb2Jyb2tlcmhvbWVfZGV2' }
getUser rick
logging in  { uid: '1234',
  name: 'rick',
  password: 'oldman',
  tokens: [ 'psokmCxKsdfsfLeYd1' ] }
login successful  rick
authCode successful  9lxxndxenwgfssdf00s04g4c
POST /login 302 6.759 ms - 1440
/token query {}
/token body { grant_type: 'authorization_code',
  code: '9lxxndxenwgfssdf00s04g4c',
  redirect_uri: 'https://oauth-redirect.googleusercontent.com/r/iobrokerhome',
  client_id: 'ghome-iobroker',
  client_secret: 'somePassword' }
getClient ghome-iobroker, somePassword
return getClient { clientId: 'ghome-iobroker', clientSecret: 'somePassword' }
client { clientId: 'ghome-iobroker', clientSecret: 'somePassword' }
handleAuthCode {}
getClient ghome-iobroker, somePassword
return getClient { clientId: 'ghome-iobroker', clientSecret: 'somePassword' }
getAccessToken =  { uid: '1234',
  accessToken: 'psokmCxKjfhk7qHLeYd1',
  refreshToken: 'psokmCxKjfhk7qHLeYd1',
  userId: '1234' }
return getAccessToken =  { token_type: 'bearer',
  access_token: 'psokmCxKjfhk7qHLeYd1',
  refresh_token: 'psokmCxKjfhk7qHLeYd1' }
respond success { token_type: 'bearer',
  access_token: 'psokmCxKjfhk7qHLeYd1',
  refresh_token: 'psokmCxKjfhk7qHLeYd1' }
POST /token 200 5.508 ms - 100
GET /service-worker.js 304 2.572 ms - -
GET /bower_components/polymer/polymer.html 200 3.188 ms - 142409

And no following outputs...

How can I see what the Action is trying to do and if there are any errors on the google side in the log?

Where can I find the Log of action?

Help me. I am facing this problem till Februar 2017 and still no progress.

Fleker commented 6 years ago

I'm currently looking into a few developers seeing this error after successfully authenticating.

GermanBluefox commented 6 years ago

Can it be because of port 447 and not 443?

GermanBluefox commented 6 years ago

Changed everything to 443... Still no lack. German, English... nothing work

GermanBluefox commented 6 years ago

If it can help, I can let the action run and you can test yourself.

Fleker commented 6 years ago

You can share the project with me, although I have thus far been unable to reproduce the errors. I have been investigating internally.

ekaransheth commented 6 years ago

@Fleker Not sure if this is related, but on my Local Ubuntu box and the request-sync request is hitting 403 "Forbidden" error.

To avoid 403 I had to enable "HomeGraph API" from google developer console, which I know is not required/captured according to the documentation. After enabling this API now the request-sync is hitting 400 "Bad Request", so not sure what is causing this as of yet.

Any insights for further investigation?

Fleker commented 6 years ago

The Request Sync documentation does mention enabling the API.

Have you linked your account to the Assistant? If you haven't done that, the REQUEST_SYNC command will be denied since there's no user to request it for.

ekaransheth commented 6 years ago

@Fleker thanks for the doc. Should have read this instead of just blindly following the instructions on GitHub README.

The account linking from my iOS Google Assistant app keeps failing with "Something Went Wrong". The node server log shows authentication was successful using rick/oldman.

Fleker commented 6 years ago

Yeah I'm aware of that issue.

GermanBluefox commented 6 years ago

It is very important for me to get this action running. So you cannot reproduce the error, it is very hard for you to get it fixed. May be I can help you with online session? Team viewer, hangout, Skype, slack session with me?

Fleker commented 6 years ago

I understand. I'm trying to identify the issue now and potential fixes. Until I have a better idea of where the failure is happening or reproduce it, an online session may not be too helpful.

Can you try this out: In your action package, add a locale like en-US and redeploy.

Fleker commented 6 years ago
{
  "actions": [{
    "name": "actions.devices",
    "deviceControl": {
    },
    "fulfillment": {
      "conversationName": "automation"
    }
  }],
  "conversations": {
    "automation" :
    {
      "name": "automation",
      "url": "https://<NGROK_DOMAIN>.ngrok.io/smarthome"
    }
  },
  "locale": "en-US"  
}
ekaransheth commented 6 years ago

@Fleker same issue with account linking (Something went wrong) after adding "locale" : "en-US" & redeploy.

Do you think it could be a timezone issue here with the local server that is simulating the Device Manufacture Cloud?

grabbman commented 6 years ago

@GermanBluefox: I hope this helps a little bit: I have it running and I had the same error message. It should not be a problem with locale, it works in german. I had also problems or misunderstanding with the ngrok.io tunnel and so took a subdomain and nginx as reverse proxy. I also had to manage let's encrypt certs.

GermanBluefox commented 6 years ago

@grabbman Please explain me a little bit.

I have it running and I had the same error message.

That means: you have google action running with Google Home and it works, although you see the same error message? And you use this action with letsencrypt certificate on some public host?

grabbman commented 6 years ago

@GermanBluefox I had this message, now it connects ans shows me the devices and i can controll them from google home mini. screenshot_20171104-055352

GermanBluefox commented 6 years ago

@grabbman Sorry. I still do not understand.

And what have you done to eliminate the message? Set locale?

grabbman commented 6 years ago

@GermanBluefox können wir irgendwie anders kommunizieren? Allerdings bin ich grad beim reifenwechsel. Ich habe am Code nix verändert, ausser meine URL angepasst

GermanBluefox commented 6 years ago

I still have a problem with locale: "en-US" and with "de-DE" I tried all combinations. Switched andorid to english and locale to "en-US"/"de-DE". Switched android to German tested again... Nothing.

GermanBluefox commented 6 years ago

@grabbman You can write me your Whatsapp oder Telegram on dogafox@gmail.com Or just use email to communication.

Fleker commented 6 years ago

It may be helpful to share your project with my email to see whether I can reproduce the error and hopefully understand why some developers are experiencing this issue.

Fleker commented 6 years ago

Let's continue discussion in issue #58