-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Google pubsub #8153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Google pubsub #8153
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a65582b
Add basic documentation for google_pubsub
timvancann 3488164
Add guide to saving data
timvancann 87221aa
Fix markdown
timvancann 2eb0a0e
:pencil: Tweaks
frenck 4036349
Make configuration quick-start proof.
timvancann 38f1c97
Merge branch 'google_pubsub' of github.com:timvancann/home-assistant.…
timvancann dff6cc7
:pencil2: Tweaks
frenck 33e6c6d
Bump release version to 0.87
timvancann e79d292
Merge branch 'google_pubsub' of github.com:timvancann/home-assistant.…
timvancann 396df02
Bump release
timvancann ada808a
Update category to History
timvancann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| --- | ||
| layout: page | ||
| title: "Google Pub/Sub" | ||
| description: "Setup for Google Pub/Sub integration" | ||
| date: 2019-01-12 13:30 | ||
| sidebar: true | ||
| comments: false | ||
| sharing: true | ||
| footer: true | ||
| logo: google-pubsub.png | ||
| ha_category: Component | ||
| ha_release: 0.86 | ||
| --- | ||
|
|
||
| The `google_pubsub` component allows you to hook into the Home Assistant event bus and send events to [Google Cloud Pub/Sub](https://cloud.google.com/pubsub/docs/overview). The current [free tier](https://cloud.google.com/free/) of GCP should allow you to sync about 1 event every 2 seconds on average (2 million invocations per month). | ||
|
|
||
| ## {% linkable_title First time setup %} | ||
|
|
||
| This assumes you already have a Google Cloud project. If you don't, please create one in the [Google Cloud Console](https://console.cloud.google.com/projectcreate) | ||
|
|
||
| You need to create a Service Account key in the [Google Cloud API Console](https://console.cloud.google.com/apis/credentials/serviceaccountkey) | ||
| - Choose a new "New Service Account", give it a name and leave the key type as JSON | ||
| - Select the role: Pub/Sub Publisher | ||
|
|
||
| This will download the Service Account JSON key to your machine. Do NOT share this with anyone. Place this file in your Home Assistant config folder. | ||
|
|
||
| Next, create a Google Pub/Sub topic in the [Google Cloud API Console](https://console.cloud.google.com/cloudpubsub/topicList). The topic name will become something like `projects/project-198373/topics/topic-name`. Note the last part only (the name you chose): `topic-name`. | ||
|
|
||
|
|
||
| ## {% linkable_title Configuration %} | ||
|
|
||
| Add the following lines to your `configuration.yaml` file: | ||
|
|
||
| ```yaml | ||
| # Example configuration.yaml entry | ||
| google_pubsub: | ||
| project_id: YOUR_PROJECT_ID | ||
| topic_name: YOUR_TOPIC_NAME | ||
| credentials_json: CREDENTIALS_FILENAME | ||
| - switch | ||
| - light | ||
| - group | ||
| filter: | ||
|
frenck marked this conversation as resolved.
Outdated
|
||
| include_domains: | ||
| - light | ||
| exclude_entities: | ||
| - light.attic | ||
| include_entities: | ||
| - sun.sun | ||
| ``` | ||
|
|
||
| {% configuration %} | ||
| project_id: | ||
| description: Project ID from the Google console (looks like `words-2ab12`). | ||
| required: true | ||
| type: string | ||
| topic_name: | ||
| description: The Pub/Sub topic name. | ||
| required: true | ||
| type: string | ||
| credentials_json: | ||
| description: The filename of the Google Service Account JSON file. | ||
| required: true | ||
| type: string | ||
| filter: | ||
| description: Filter domains and entities for Google Cloud Pub/Sub. | ||
| required: false | ||
| type: map | ||
| keys: | ||
| include_domains: | ||
| description: List of domains to include (e.g., `light`). | ||
| required: false | ||
| type: list | ||
| exclude_domains: | ||
| description: List of domains to exclude (e.g., `light`). | ||
| required: false | ||
| type: list | ||
| include_entities: | ||
| description: List of entities to include (e.g., `light.attic`). | ||
| required: false | ||
| type: list | ||
| exclude_entities: | ||
| description: List of entities to include (e.g., `light.attic`). | ||
| required: false | ||
| type: list | ||
| {% endconfiguration %} | ||
|
|
||
| ### {% linkable_title Saving the data using a Google Cloud Function %} | ||
|
|
||
| To save your data automatically to BigQuery, follow the [instructions here](https://github.com/timvancann/home-assistant-pubsub-cloud-function). The current [free tier](https://cloud.google.com/free/) of GCP should allow to store up to 10GB of data. | ||
|
|
||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.