Google Assistant Setup

Look I’m new to this. Just a few questions as I’m getting an error - permission denied when I enter the code after executing gactions - I go to the URL and get the code but it gives a permission denied when I enter it.

I also re-booted mt HA after entering the info in config file and it would not restart.

A few places where I need clarification and I might be screwing up.

  1. configuration.yaml
    The client_id and access_token are shown withing [] - are the square brackets needed or is it just the long URL that should be entered?
    I did use the [] and the config validated but when I restarted HA it just didn’t start. I also rebooted my Pi and it didn’t start. As soon as I removed the added section it started.
    Also my project ID is not in the format of someproject-2d0b8 - when I went to the developer console and selected add/import project it did not give me a project name but merely prompted for me to enter a name which I did. I also set it to Australia instead of the United States - is this a possible problem?

  2. I am assuming the customize code homeassistant: is optional and not needed to make it work?

  3. in project.json, I assume the URL would be something like https://myduckdns.duckdns.org>8123/api/google_assistant
    Now I am assuming that the URL has to be enclosed in “” as it’s a JSON file and that seems to be the syntax? I also am not sure as in one of the other threads, I see the google_assistant part of the URL is followed by /apps Is this needed??? If so it’s not included in the configuration doc at https://home-assistant.io/components/google_assistant/

  4. WHen I ran the gactions, the URL it spit out looked nothing like https://console.actions.google.com/project/doctest-2d0b8/overview
    My URL was actually like: https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=xxxxxxxxxxx-xxxxxxx.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Factions.builder&state=state
    Now I am wondering if I should have run it from the virtual environment? I had to use sudo chmod to make gactions executable so I’m just not sure if I should have switched to the virtual environment before I downloaded gaactions and created project.json? Going to the URL did ask me to authorize my google account which I did and I got a code to enter into putty but that is where I got the permission denied error.

That’s as far as I got.

I should probably add I’m using the Raspberry Pi all-in-one using stretch and a raspberry pi series 2.

Any advice?

1.no square brackets. just random code you generate
google actions page>>overview>>select the gear to enter settings>>select “project setting”>>you will see your project ID

2.not sure what your asking but GA just work after you finish setup. “OK Google, Living Room ON” just works after you follow the setup guide

3.Yes, In quotes. /apps not needed. These are separate url for separate purposes. The setup guide is spot on (no errors or omissions)

4.Nope, not from VM. I use docker and ran this on the host machine outside of the docker container. Honestly I think you can run it anywhere as it did not generate any files only generate output for use in setup. .json file will need to be visible and accessible by VM but not necessary to run in VM (my belief but I dont use VM so not tested) As stated thought, if vm has permission to file and file is in correct location then running outside VM, i dont think, is an issue.

I was referring to the document which has a customize section in it to add to configuration.yaml - I am assuming that is optional.

I got gactions command to work finally - I added sudo in front and it worked.

Plowing through the rest of the setup now.

The doc should remove the [] from the client id and access token as it confused me and I am sure it will confuse others as well.

Thanks for your help.

@DavidFW1960 'm having the exact same problem you identified in item #4 in the OP. The URL it spits out after running gactions looks nothing like the one in the setup instructions. It takes me to a page that contains a long string that it tells me to paste back into my application (PuTTy in my case), but when I do that, i get an OAuth error.

You said something about using sudo to get it working, but using sudo in front of gactions doesn’t change anything for me. Did you do anything else to get this working? I haven’t added the configuration in my configuration.yaml file yet, does that matter?

I can’t remember now but I am pretty sure I did step by step - I had edited my yaml file before moving on to the next step. I had to use sudo to get gactions to work. Even though the URL looked odd it all worked. don’t forget the ./ in front of gactiona (I think it is)

I just followed all the instructions verbatim step by step.