Publish Timeseries

Overview

MQTT can be used to assign timeseries data to Process Variables inside TilliT at a frequency of a minute or on change(but no faster then a minute between changes). If you have requirements for faster timeseries data, ensure you contact the TilliT team to ensure your requirements can be met.

Timeseries Payload

Below is an example of the timeseries payload that is sent via MQTT to be ingested into TilliT.

[{
    assetId: number;
    timestamp: string;
    processVariableId: number;
    numericValue?: number | null;
    stringValue?: string | null;
    booleanValue?: boolean | null;
}]

Every timeseries entry is associated with both a Process Variable and Asset. For example, Temperature on Filler 1, Temperature on Depal 4, Pressure on FIller 2 etc. To find the id's of these objects, you may want to use the API to keep them up to date. Only one of numericValue, stringValue and booleanValue is required and will be up to the type of data you are collecting.

Sending to the MQTT Broker

For timeseries data at a frequency greater than a minute, contact support to ensure the appropriateness of your solution

The topic to publish on is constructed as per the following, replacing tenant and thingName with those that apply for you

$aws/rules/production_edge_data/tenant/thingName/timeseries

You can find your thingName contained in the same file as the certificates supplied to you. You can also contact support to track down the thingName for you.

Now follow these steps to successfully add timeseries data

Find an asset to add timeseries to and record it's ID.

Find a process variable to add timeseries to and record it's ID.

Create a timeseries dashboard for the Process Variable and Asset

Publish the following payload on the topic specified prior (replace ids with yours and timestamp of today)

{
  format: 'json',
  body: [{
    assetId: 2,
    timestamp: '2022-06-30T05:28:40.273Z',
    processVariableId: 80,
    numericValue: 52
  }]
}
	

See that the dashboard has updated with a single data point. Send more messages with the a different timestamp and numericValue to see the graph build.

Last updated