App

Create new Google PubSub Integration

Connecting to Google PubSub

Use the following steps to setup the Google Pub/Sub Integration.

Create your PubSub Topic

  1. Go to the Cloud PubSub topics page in the GCP Console.

  2. Click Create Topic, enter a name and complete adding your new topic. Once completed, make note of the complete topic string shown in Topic details - you will need this information later when setting up the Integration.

image-20210917-220255.png
image-20210917-220305.png

Setup your Cloud Storage Account Service key

In this step we will setup an account key which will then be used by the Integration so that it can publish events.

  1. In the Google Cloud console and go to IAM & admin and select the Service accounts option.

    image-20210917-220422.png
  2. Click on Create Service Account.

    image-20210917-220429.png
  3. Give the account an appropriate Name and description. The Service account ID will be generated automatically for you during this step - you can leave it as the default.

    image-20210917-220606.png
  4. Click Create to create the service account and continue.

  5. On the Permissions screen that appears, give the account the permission PubSub Publisher so that it can publish events.

    image-20210917-220618.png
  6. Locate the Service account you created, click on the 3-dot menu and select Create Key.

    image-20210917-220626.png
  7. In the popup that appears, you can leave it as JSON and click Create. This will download a json file containing the private key information that we need when setting up the integration.

    image-20210917-220645.png
  8. Open the downloaded json file. You will need to copy the entire contents from this file when asked during integration setup.

    image-20210917-220726.png

Create the Integration

  1. Log into your IoT dashboard account where all of your devices are located.

  2. Go to ☰ → INTEGRATIONS and then select the Google PubSub integration.

  3. Enter the following information to complete the integration:

    • Name: Enter a name for this integration. In case you have multiple integrations, this will help uniquely identify it in the list.

    • Topic: Enter the complete topic string for your topic.
      💡 Be sure that you copy the complete string, including both topic & project id here.

    • Service Account Key: Paste the entire contents of the service key file, as obtained above.
      💡 Paste the entire contents of the json private key file here.

    • Event Subscriptions: In this field you can select whether your integration should pass sensor data received (uplink), gateway keepalive (ping), and alert events.

    • Device Subscriptions: In this field you can select specific devices for the integration to monitor. By default All Devices are selected.

      PubSub.png
  4. In the Data Fields area, you can customize the specific data points passed by the integration. By default all fields are selected.

    DataFields.png
  5. Click Save Google PubSub to finish.