mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-18 23:06:58 +00:00
Move setup up
This commit is contained in:
parent
24b1de1bf6
commit
0711657f5b
@ -25,6 +25,37 @@ The Google Assistant component requires a bit more setup than most due to the wa
|
||||
To use Google Assistant, your Home Assistant configuration has to be externally accessible with a hostname and SSL certificate. If you haven't already configured that, you should do so before continuing.
|
||||
</p>
|
||||
|
||||
## {% linkable_title Setup %}
|
||||
|
||||
You need to create an API Key with the [Google Console](https://console.cloud.google.com/apis/api/homegraph.googleapis.com/overview) which allows you to update devices without unlinking and relinking an account (see [below](/#troubleshooting-the-request_sync-service)). If you don't provided it the `google_assistant.request_sync` service is not exposed. It is recommended to set up this configuration key as it also allows the usage of the following command, "Ok Google, sync my devices". Once you have setup this component you will need to call this service (or command) each time you add a new device that you wish to control via the Google Assistant integration.
|
||||
|
||||
1. Create a new project in the [developer console](https://console.actions.google.com/).
|
||||
a. Add/Import project, give it a name
|
||||
b. Click on `Home Control` card, select the `Smart home` recommendation.
|
||||
c. Create an Action, under the build section. Add in your Home Assistant URL: `https://[YOUR HOME ASSISTANT URL:PORT]/api/google_assistant`, replace the `[YOUR HOME ASSISTANT URL:PORT]` with the domain / ip address and the port under which your Home Assistant is reachable. If you have set `api_password:` add this password to the URL. E.g., `https://[YOUR HOME ASSISTANT URL:PORT]/api/google_assistant?api_password=[YOUR API PASSWORD]`)
|
||||
d. Click `Done`. Then click on `Overview`, which will lead you back to the app details screen.
|
||||
2. `Account linking` is required for your app to interact with Home Assistant. Set this up under the `Quick Setup` section
|
||||
a. Leave it at the default `No, I only want to allow account creation on my website` and select Next
|
||||
b. For the `Linking type` select `OAuth` and `Implicit`
|
||||
c. Client ID: The `client_id` from your Home Assistant configuration above
|
||||
d. Authorization URL (replace with your actual URL): `https://[YOUR HOME ASSISTANT URL:PORT]/api/google_assistant/auth`. If you have set `api_password:` add this password to the URL `https://[YOUR HOME ASSISTANT URL:PORT]/api/google_assistant/auth?api_password=[YOUR API PASSWORD]`)
|
||||
e. Configure your client. Add scopes for `email` and `name`.
|
||||
f. Testing instructions: Enter anything. It doesn't matter since you won't submit this app.
|
||||
3. Back on the overview page. Click `Simulator` under `TEST`. You don't have to actually test .
|
||||
4. If you haven't already added the component configuration to `configuration.yaml` file and restarted Home Assistant, you'll be unable to continue until you have.
|
||||
5. Open the Google Assistant app and go into `Settings > Home Control`
|
||||
6. Click the `+` sign, and near the bottom, you should have `[test] your app name`. Selecting that should lead you the screen where you can set rooms for your devices or nicknames for your devices.
|
||||
7. If you want to allow other household users to control the devices:
|
||||
a. Go to the settings for the project you created in point 1 in the developer console.
|
||||
b. Under the gear icon, click `Permissions`
|
||||
c. Click `Add`, type the new user's e-mail address and choose `Project -> Editor` role
|
||||
d. Have the new user go to [developer console](https://console.actions.google.com/) and repeat steps starting from point 3
|
||||
8. If you want to use the `google_assistant.request_sync` service, to update devices without unlinking and relinking, in Home Assistant, then enable Homegraph API for your project:
|
||||
a. Go to the [cloud console](https://console.cloud.google.com/apis/api/homegraph.googleapis.com/overview)
|
||||
b. Select your project and click Enable Homegraph API
|
||||
c. Go to Credentials, which you can find on the left navigation bar under the key icon, and select API Key from Create Credentials
|
||||
d. Note down the generated API Key and use this in the configuration
|
||||
|
||||
## {% linkable_title Configuration %}
|
||||
|
||||
To enable this, add the following lines to your `configuration.yaml` file:
|
||||
@ -73,11 +104,11 @@ agent_user_id:
|
||||
required: false
|
||||
type: string
|
||||
api_key:
|
||||
description: An API Key generated for the project from [Google Console](https://console.cloud.google.com/apis/api/homegraph.googleapis.com/overview) which allows you to update devices without unlinking and relinking an account (see [below](/#troubleshooting-the-request_sync-service)). If not provided then the `google_assistant.request_sync` service is not exposed. It is recommended to set up this configuration key as it also allows the usage of the following command, "Ok Google, sync my devices". Once you have setup this component you will need to call this service (or command) each time you add a new device that you wish to control via the Google Assistant integration.
|
||||
description: Your API key.
|
||||
required: false
|
||||
type: string
|
||||
expose_by_default:
|
||||
description: Expose devices in all supported domains by default. If set to false, you need to either expose domains or add the expose configuration option to each entity in entity_config and set it to true.
|
||||
description: "Expose devices in all supported domains by default. If set to false, you need to either expose domains or add the expose configuration option to each entity in `entity_config` and set it to true."
|
||||
required: false
|
||||
default: True
|
||||
type: boolean
|
||||
@ -114,6 +145,7 @@ entity_config:
|
||||
{% endconfiguration %}
|
||||
|
||||
### {% linkable_title Available domains %}
|
||||
|
||||
Currently, the following domains are available to be used with Google Assistant, listed with their default types:
|
||||
|
||||
- group (on/off)
|
||||
@ -135,35 +167,6 @@ $ cat /dev/urandom | fold -w 120 | head -n 1 | base64 -w 0 | tr -dc '0-9A-Za-z'
|
||||
|
||||
If you're not using Linux, you can use sites such as [this one](https://www.browserling.com/tools/random-string) to generate a random string (containing mixed case letters and numbers) of up to 80 characters.
|
||||
|
||||
### {% linkable_title Setup %}
|
||||
|
||||
1. Create a new project in the [developer console](https://console.actions.google.com/).
|
||||
a. Add/Import project, give it a name
|
||||
b. Click on `Home Control` card, select the `Smart home` recommendation
|
||||
c. Create an Action, under the build section. Add in your home assistant url: `https://[YOUR HOME ASSISTANT URL:PORT]/api/google_assistant`, replace the `[YOUR HOME ASSISTANT URL:PORT]` with the domain / ip address and the port under which your Home Assistant is reachable. If you have set `api_password:` add this password to the URL - eg `https://[YOUR HOME ASSISTANT URL:PORT]/api/google_assistant?api_password=[YOUR API PASSWORD]`)
|
||||
d. Click `Done`. Then click on `Overview`, which will lead you back to the app details screen.
|
||||
2. `Account linking` is required for your app to interact with Home Assistant. Set this up under the `Quick Setup` section
|
||||
a. Leave it at the default `No, I only want to allow account creation on my website` and select Next
|
||||
b. For the `Linking type` select `OAuth` and `Implicit`
|
||||
c. Client ID: The `client_id` from your Home Assistant configuration above
|
||||
d. Authorization URL (replace with your actual URL): `https://[YOUR HOME ASSISTANT URL:PORT]/api/google_assistant/auth`. If you have set `api_password:` add this password to the URL `https://[YOUR HOME ASSISTANT URL:PORT]/api/google_assistant/auth?api_password=[YOUR API PASSWORD]`)
|
||||
e. Configure your client. Add scopes for `email` and `name`.
|
||||
f. Testing instructions: Enter anything. It doesn't matter since you won't submit this app.
|
||||
3. Back on the overview page. Click `Simulator` under `TEST` - you don't have to actually test .
|
||||
4. If you haven't already added the component configuration to `configuration.yaml` and restarted Home Assistant, you'll be unable to continue until you have.
|
||||
5. Open the Google Assistant app and go into `Settings > Home Control`
|
||||
6. Click the `+` sign, and near the bottom, you should have `[test] your app name`. Selecting that should lead you the screen where you can set rooms for your devices or nicknames for your devices.
|
||||
7. If you want to allow other household users to control the devices:
|
||||
a. Go to the settings for the project you created in point 1 in the developer console.
|
||||
b. Under the gear icon, click `Permissions`
|
||||
c. Click `Add`, type the new user's e-mail address and choose `Project -> Editor` role
|
||||
d. Have the new user go to [developer console](https://console.actions.google.com/) and repeat steps starting from point 3
|
||||
8. If you want to use the `google_assistant.request_sync` service, to update devices without unlinking and relinking, in Home Assistant, then enable Homegraph API for your project:
|
||||
a. Go to the [cloud console](https://console.cloud.google.com/apis/api/homegraph.googleapis.com/overview)
|
||||
b. Select your project and click Enable Homegraph API
|
||||
c. Go to Credentials, which you can find on the left navigation bar under the key icon, and select API Key from Create Credentials
|
||||
d. Note down the generated API Key and use this in the configuration
|
||||
|
||||
### {% linkable_title Troubleshooting the request_sync service %}
|
||||
|
||||
The request_sync service requires that the initial sync from Google includes the agent_user_id. If not, the service will log an error that reads something like "Request contains an invalid argument". If this happens, then [unlink the account](https://support.google.com/googlehome/answer/7506443?hl=en-GB) from Home Control and relink.
|
||||
|
Loading…
x
Reference in New Issue
Block a user