Google Assistant Setup Issue - "Could not update the setting. Please check your connection"

@christian667 I only had one light configured as per the example output i pasted earlier.

I have more now including some scripts exposed as scenes.

I have en-us,en-gb,es-ES locales on my device.

@darkskiez I suppose it’s not depending on the phones locale settings… Which size do your keys have? I used the provided method to create the token and the client id. Did you make any adjustments to the project.json provided in the wiki?

I think my project.json has the “automation” word replaces in all three instances with the invocation name set in my google project. I’m a little scared to change it or test now I have it working!

Perhaps it needs an IPv4 address on the end point?

Oh, I have a 20 char client id and the access_token is erm… 53

when I push my app test on home control it redirects me to a black page with a {“message”: “missing project_id in redirect_uri”}

any clue?

Have you defined your project_id in the Google Assistant component? It should be the project id that the developer console generated for you.

It sounds like this thread might help with your issue.

For the record, I still cannot get past the “Could not update the setting. Please check your connection” error, despite trying everything everyone has suggested in this thread :frowning:

1 Like

@mp3llll this looks like the missing project_id / wrong project id problem (like chris-thorn mentioned).
@darkskiez my client id and my token have both the suggested 80 characters length… maybe this is too much?

I don’t think IPv6 should make any different as the first contact works and as I understand the concept the phone needs to reach the home assistant - not Google or any other entity, because they only redirect (oauth like).

I tested replacing the “automation” key word with the invocation name in all 3 instances - quite strange - this didn’t make any difference at all (I thought it might throw at least an error in the home-assistant log).

At the moment the hass log don’t print out the google assistant connection attempts, maybe they removed the output with the latest update…

For docker just ssh to server and perform all in config folder.

Really this can be done from any PC and just copy project.json to config when complete (I believe). Ultimately you just want proper link in .json file and project setup in gcloud

I figured out I needed to add the logger component and set it to “info” to see the google assistant requests, but nothing changed

2017-11-08 00:30:54 INFO (MainThread) [homeassistant.components.http] Serving /api/google_assistant/auth to IPV6ADDRESS (auth: False)
2017-11-08 00:30:54 INFO (MainThread) [homeassistant.components.google_assistant.auth] user login in from Google Assistant

@tmjpugh I use ssh to connect to the host, exec bash on the hass running docker, check the log/alter the config and restart the docker

@tmjpugh Did you make any changes to the provided project.json?

Mine is looking like this

{
  "actions": [{
    "name": "actions.devices",
    "deviceControl": {
    },
    "fulfillment": {
      "conversationName": "automation"
    }
  }],
  "conversations": {
    "automation" :
    {
      "name": "automation",
      "url": "https://MYDOMAIN/api/google_assistant"
    }
  }
}

Followed instructions…did not deviate…work perfectly

I believe I change project.json url per docs.

Thanks! I read it here before my post.

project_id are same on Google, I don’t know what more need to test…

Actually thats not true, it is invoked from google and not your phone…

The first contact works because thats your device getting the access token via oauth to give to the google service to be able to talk directly on your behalf.

Eg, in my access logs:

homeassistant.dyndns.name:443 66.249.93.17 - - [07/Nov/2017:23:36:46 +0100] “POST /api/google_assistant HTTP/1.1” 200 3555 “-” “Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)”

@darkskiez Thanks for the hint, do I get the schematics right:

  1. We start the assistant configuration on the phone
  2. The phone assistant connects to the hass installation, submitting the client id & token received by the google authentication (which should match the actions console configuration online)
  3. The phone assistant forwards googles assistant services (online) the token/clientid
  4. Google assistant services connect to the hass installation, requesting the devices via SYNC
  5. Devices and configuration are transfered back to the assistant app on the phone

If this is more or less correct it might fail because of my missing ipv4 connection. I will create a ipv4-to-ipv6 proxy (using iptables?) tonight forwarding ipv4 through a virtual server online.

So I’m getting the same problem, pretty sure I have the setup done correctly, but here is my tuppence worth to try and help debug this.

  1. I have Two Factor authentication on my google account that this is using
  2. Have tried all of the suggestions on this thread.
  3. If I change the client-id on the GActions console to something different to my configuration.yaml file I get a different error:

{“message” : “invalid client id”}

i’m also a bit confused about how google knows about the access token, as nowhere in the instructions do I ever tell them about it, or is this exchanged as part of the authentication steps?

Also I am in the UK, on hassio HASS 5.7.2

============Update now have this working=============================
The things I changed

  1. Tried various client ids, it does not matter what you use as long as the Gactions ClientID field matches your configuration.yaml entry
  2. Tried various access tokens in configuration.yaml, all seem to work
  3. I re-ran the "gactions update --action_package project.json --project mygactions-projectID in the CMD terminal after each change
  4. I re-ran the gactions console “Test Draft” button after each change
  5. I restarted Home Assistant after each change
  6. I moved the Google assistant config to the end of my configurations.yaml and made sure that all of the spaces are correct in each line.
  7. my project.json file looks like this

{
“actions”: [{
“name”: “actions.devices”,
“deviceControl”: {
},
“fulfillment”: {
“conversationName”: “automation”
}
}],
“conversations”: {
“automation” :
{
“name”: “automation”,
“url”: “https://myexternalurl.duckdns.org/api/google_assistant
}
}
}

My configuration.yaml looks like this

google_assistant:
  project_id: mygactions-1234a
  client_id: XXXXXXXlongstring
  access_token: YYYYYYYanotherlongstring
  exposed_domains:
    - switch

Now the first time I try to add my device it gives the “connection error”, but on second try it goes through and adds my devices to the list and allows me to assing rooms.

I have unlinked and relinked the devices several times and it seems to be working well
Now of to play :slight_smile:

Okay I setup a relay/proxy using an ipv4 virtual server online using socat:

nohup socat TCP4-LISTEN:443,fork,su=nobody TCP6:MYDOMAIN:443 &

With this everything is working fine and I can control my IKEA tradfri lights using the assistant without any further configuration changes (the wiki setup works just fine).

@Oldbloke as I understand the oauth flow here, you phone fetches the token from you hass installation with the first connection step and passes it to the google service.

@christian667
Very interesting that you have it working now through a ipv4 proxy . I’m in the UK with BT, I think my Broadband uses V6. Will have a look, can you explain in more detail why Google needs V4.

I had this problem and solved it. The guide here: https://home-assistant.io/components/google_assistant/

…at time of writing says you should provide your client_id from the homeassistant/configuration.yaml google_assistant block to the account linking page, along with your api URL. This is didn’t work for me. I had to provide the access_token in the account linking -> client information -> client ID box, not the client_id.

I think the documentation is out of date. You’re told to configure two long random strings for the google_assistant block, but only ever use one of them? Why create two?

I tried entering the access_token string instead of the client_id as you suggested, but I got the following error:

{"message": "invalid client id"}

Yup, you use the client_id - as far as I can tell the access token is provided by Home Assistant to Google as part of the OAuth setup.