Skip to content

Create a Data Stream

Reference:

Field Description
Name Unique name identifier. It must contain only lowercase alphanumeric characters. The characters ., _ and - are allowed to separate words instead of a space BUT can not be at the beginning or end of the name.
Title The display name to show on the Kelvin UI. It can contain any characters, including spaces.
Description Optional description for the data stream, up to 200 characters.
Type Determines if the data is directly derived from sensors or is processed/calculated. Allowed values: Measurement or Computed.
Semantic Type Provides context or deeper meaning behind the data, beyond just its format or structure. Check Kelvin API for the full list of available semantic types.
Data Type Specifies the kind of data in the stream. Allowed values: Boolean, Number, Object, String.
Unit Defines the measurement unit for data. Check Kelvin API for the full list of available units.

Create Data Stream

In this example we will create a Data Stream with the Semantic Type Pressure and with the name tubing_pressure.

You can watch this short demo video or read the full step-by step written tutorial below.

Go to the Data Streams page and click on the Create Data Stream button.

You then have two choices. Select Measurement or Computed and click next.

Mandatory field are the Display Name and Data Type. After filling this information you can click Create.

The Name ID is automatically created when you type in your Display Name.

Optionally you can also fill in a Unit and Semantic Type.

For the Unit, you can also create new Units on-the-fly by clicking on the Add Unit button.

A popup will appear where you can create the new unit. Once created, you can then select it and click Create to create the new Data Stream.

curl -X "POST" \
"https://<url.kelvin.ai>/api/v4/datastreams/create" \
-H "Authorization: Bearer <Your Current Token>" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
        "name": "doc_demo_data_stream",
        "title": "Docs Demo Data Stream",
        "description": "Demo for Documentation",
        "type": "measurement",
        "semantic_type_name": "pressure",
        "data_type_name": "number",
        "unit_name": "pound_per_square_inch"
    }'
from kelvin.api.client import Client

# Login
client = Client(config={"url": "https://<url.kelvin.ai>", "username": "<your_username>"})
client.login(password="<your_password>")

# Create Data Stream
response = client.datastreams.create_data_stream(
    data={
        "name": "doc_demo_data_stream",
        "title": "Docs Demo Data Stream",
        "description": "Demo for Documentation",
        "type": "measurement",
        "semantic_type_name": "pressure",
        "data_type_name": "number",
        "unit_name": "pound_per_square_inch",
    }
)

print(response)