How-To Guides
Integration Guides

Cognite Integration Guide

19min

Review the following guide for setting up an integration between Litmus Edge and Cognite. Once the integration is set up, you can send and receive data through the Cognite connector.

Cognite Platform
Cognite Platform


Before You Begin

You must have access to Cognite Data Fusion.

Step 1: Collect Cognite Connection Parameters

You will need to retrieve the following parameters to configure the connection.

Project ID

The project ID is the unique identifier assigned to each project within Cognite.

To get the project ID:

  1. Sign in to Cognite Data Fusion.
  2. In the top-left corner, open the environment identifier to view the list of project IDs. Select the appropriate one to integrate with Litmus Edge.

    Document image
    

Refer to Projects API documentation to learn more.

Tenant ID

Sign in to the Microsoft Entra admin center and navigate to Identity > Overview > Properties. See How to find your Microsoft Entra ID to learn more.

Client ID

To retrieve the client ID, you will need to register the Cognite account as an application in Microsoft Entra. If you don't have the appropriate permissions to create a client ID, follow up with your IT department. See Quickstart: Register an application with the Microsoft identity platform > Register an application to learn more.

Client Secret

To retrieve the client secret, you will need to register the Cognite account as an application in Microsoft Entra, and then create the client secret. Please note that the secret value is only visible when it is created, and not available to view after. If you don't have the appropriate permissions to create a client secret, follow up with your IT department. See Quickstart: Register an application with the Microsoft identity platform > Add a client secret to learn more.

Cluster

A cluster is a grouping of resources within the platform.

To retrieve the cluster value:

  1. Log in to Cognite Data Fusion.
  2. Navigate to Data Management > Manage > Manage Access.
  3. Click the OpenID connect tab.
  4. Refer to the Audience field. The cluster value is between https:// and .cognitedata.com.

For example, if the audience value is https://az-eastus-1.cognitedata.com, the cluster value is az-eastus-1.

Scope

The scope specifies the level of access and permissions granted to an application in the Cognite platform.

To retrieve the scope value:

  1. Log in to Cognite Data Fusion.
  2. Navigate to Data Management > Manage > Manage Access.
  3. Click the OpenID connect tab.
  4. Refer to the Audience field and update it as needed for the scope.

For example, if the audience value is https://az-eastus-1.cognitedata.com, the scope value can be https://az-eastus-1.cognitedata.com/.default. Follow up with your IT department for further assistance.

Step 2: Add Cognite Connector in Litmus Edge

Follow the steps to Add a Connector and select the Cognite Connector provider.

Configure the following parameters.

Parameter

Description

Name

Enter a name for the connector.

Project ID

Enter the value retrieved in Step 1.

Tenant ID

Enter the value retrieved in Step 1.

Client ID

Enter the value retrieved in Step 1.

Client Secret

Enter the value retrieved in Step 1.

Cluster

Enter the value retrieved in Step 1.

Scope

Enter the value retrieved in Step 1.

Subscribe interval

Enter the interval (in seconds) that the connector polls for data.

Throttling limit

The maximum number of messages per second to be processed. The default value is zero, which means that there is no limit.

Persistent storage

When enabled, this will cause messages to undergo a store-and-forward procedure. Messages will be stored within Litmus Edge when cloud providers are online.

Queue Mode

Select the queue mode as lifo (last in first out) or fifo (first in first out). Selecting lifo means that the last data entry is processed first, and selecting fifo means the first data entry is processed first.

Step 3: Enable the Connector

After adding the connector, click the toggle in the connector tile to enable it.

Document image


If you see a Failed status, you can review the Connector Logs and relevant error messages.

Step 4: Set up Connection (Outbound or Inbound) with Cognite

You have the option of setting up an outbound or inbound connection.

Set up Outbound Connection

To set up an outbound connection, you will need to create a DeviceHub device and tags. The tags will be used to send data to Cognite.

Step a: Add Device



Step b: Add Tags



Step c: Create Outbound Topics for Connector

You will now need to import the tags you added to the connector as topics.



After adding all required topics, navigate to the Integration overview page and ensure the connector is not disabled and still shows a CONNECTED status.

Step d: Enable Topics



Step e: Verify Connection in Cognite

You can verify the connection is successfully sending data by navigating the Cognite Data Explorer. See Explore data to learn more.

Set up Inbound Connection

You have the option of subscribing to data from Cognite. The data that is subscribed to is a loopback as it is first sent from Litmus Edge to Cognite, and then back to Litmus Edge as time-series data.

Step a: Create Assets and Time Series

To set up an inbound connection, you will need to create assets and time series as needed in Cognite through API. See Assets and Time Series to learn more.

Once you set up assets and time series, copy the IDs for the time series. You will refer to the IDs when configuring the remote topic names for the inbound connection.

To collect the time series IDs:

  1. Log in to Cognite Data Fusion.
  2. Click Data Explorer.
  3. Click the appropriate asset name to select it.
  4. Click the Time series tab.
  5. Click the appropriate time series name to select it.
  6. Under General, click the Copy icon for ID.

Step b: Create Inbound Topics for Connector

You will create topics for the connector that will subscribe to data from associated Cognite time series IDs.

To create inbound topics:

  1. Navigate to Integration.
  2. Click the connector tile.
  3. Click the Topics tab.
  4. Click the Add a new subscription icon. The Data Integration dialog box appears.

    Add a new subscription icon
    Add a new subscription icon
    
  5. Configure the following parameters.
    • Data Direction: Select Remote to Local - Inbound.
    • Local Data Topic: Enter a topic name that will be used for subscribing to data in Litmus Edge.
    • Remote Data Topic: Copy and paste the associated time series ID collected in the previous step.
    • Enable: Select the toggle to enable the topic.
  6. Click Yes to add the topic.
  7. From the connector tile, ensure the connector is not disabled and still shows a CONNECTED status. Also verify the topic shows an Enabled status.

Step c: Verify Connection in Litmus Edge

You have several options for verifying the connection in Litmus Edge. When subscribing to the data, you will need to use the Local Data Topic name configured in the previous step.

You can visualize the incoming data using one of the dedicated Applications such as Grafana.

You can also view the data in the Flows Manager and Analytics areas of Litmus Edge.