The chat responses are generated using Generative AI technology for intuitive search and may not be entirely accurate. They are not intended as professional advice. For full details, including our use rights, privacy practices and potential export control restrictions, please refer to our Generative AI Service Terms of Use and Generative AI Service Privacy Information. As this is a test version, please let us know if something irritating comes up. Like you get recommended a chocolate fudge ice cream instead of an energy managing application. If that occurs, please use the feedback button in our contact form!
Skip to content
Insights Hub and Industrial IoT

Insights Hub drives smart manufacturing through the industrial Internet of Things. Gain actionable insights with asset and operational data and improve your processes.

IoT TS Aggregates Client for Java¶

Introduction¶

The IoT TS Aggregates Java client allows you to query aggregated time series data. Refer to IoT TS Aggregates for more information about the service.

Further implementation of the TS Aggregate SDK library has been shown in a sample project that you can download and test in local or on Insights Hub application. Please refer to this repository: industrial-iot-java-sdk-examples

Hint

In the IoT context, assets are referred to as entity and aspects as propertyset.
Placeholders in the following samples are indicated by angular brackets < >.

TS Aggregates Operations¶

Client name: AggregatesClient

Read Aggregated Time Series¶

This section shows two options for reading aggregated time series data of a specific aspect of an asset from the specified time range. This feature is only available if aspect data is available within the specified time range.

Note

A query can only return up to 200 aggregate intervals in one response.
Aggregates can only be created from up to 5,000 raw time series entries.

// Construct the AggregatesClient object
AggregatesClient aggregate_client =  AggregatesClient.builder()
                                            .mindsphereCredentials(<credentials>)
                                            .restClientConfig(<config>)
                                            .build();

List<Aggregates> aggregate_list = null;
try {
  aggregate_list = aggregate_client.getAggregateTimeseries(<entity_id>, <property_set>, <from>, <to>, <interval_value>, <interval_unit>, <select>);
} catch (MindsphereException e) {
  // Exception handling
}

Alternatively, use the GetAggregateTimeseriesRequest model.

// Construct the AggregatesClient object as shown above

GetAggregateTimeseriesRequest request_object = new GetAggregateTimeseriesRequest();
request_object.setEntity(<entity_id>);
request_object.setPropertyset(<property_set>);
request_object.setFrom(<from>);
request_object.setTo(<to>);
request_object.setIntervalValue(<interval_value>);
request_object.setIntervalUnit(<interval_unit>);
request_object.setSelect(<select>);

List<Aggregates> aggregate_list = null;
try {
  aggregate_list = aggregate_client.getAggregateTimeseries(request_object);
} catch (MindsphereException e) {
  // Exception handling
}