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

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.

how do i check if im on ipv4 or 6? Im on virgin media in the UK.

EDIT: I used ipv6-test.com and it says im only on ipv4…

Any one else know why mine still isnt working?

Ok it’s perfectly working in french.
I do not know why my first json file contains a url ending by /auth/
Just have to remove this string and execute once again the gaction exe

Nice !
:smiley:

I have it up and running. The guide at https://home-assistant.io/components/google_assistant/ is great. For all people who havent attempted yet, just read the directions carefully. I was doing it quick and overlooked a couple of small details. Once I reread it carefully, it worked.

Also, is there anyway to include locks or is there already a PR for this? I have a Schlage zwave lock I would like connected through google assistant. I was just wondering if I missed it somewhere.

I am receiving this after a fresh new install. What shall I do?

any luck nailing down where the issue lies? I am having the same problem :frowning:

Hi All,

This is basically my first post in the forum, so I will start by saying a big Thank You to the whole home-assistant community, both for this fantastic piece of software and the very useful discussions/suggestions/q&a in here.

I was following this topic as I was facing the exact same issue: in the beginning, I got this working perfectly about a month ago at first attempt, then last week I made some changes, unlinked to refresh my devices and couldn’t relink again (recieving the exact same error in the google assistant android app).

I finally found out that the problem was caused by a couple of dummy lights that I had setup to control some other devices through google assistant, which did not have a friendly_name. Fixing this (just yesterday evening) actually solved the problem.

My recommendation would be to start again with “expose_by_default: false” in the configuration, and then start exposing one thing after the other, until you spot which one creates the issue.

Dimitris

P.S.1. I am running hassio on a RPi3 and I only use google assistant through my android (I don’t have a google home). I am also using duckdns and letsencrypt.

P.S.2. If this solves the problem, maybe a relevant comment should be added to the documentation.

I am trying to follow what you doing here and it’s not working. Here’s my config so maybe someone can spot if I am doing something wrong.

configuration.yaml

google_assistant:
  project_id: !secret google_project
  client_id: !secret google_client
  access_token: !secret google_token
  expose_by_default: false

customize.yaml

light.desk_lamp:
  google_assistant: true
  google_assistant_name: Jim Bob
  aliases:
    - James Robert

Yes, I know the names are dumb but I just wanted to test this. the desk lamp is the only device that should be exposing itself to google assistant (and I am hoping google assistant will like it)