Get Started with the TimeSeries Connector

Last update: Edit

1 Introduction

This how-to is focused on implementing and understanding the TimeSeries Connector and the TimeSeries Analytics platform. The TimeSeries Connector is especially useful when your application needs to handle large amounts of data.

When looking at the IoT trend recently, one hundred sensors that send data each minute will send 144.000 objects to your database per day, one hundred and fifty will send 216.000 objects. See how these numbers start to add up once you add a few more sensors? Now imagine having your standard relational database handle this amount of data, let alone perform analysis on it. The TimeSeries Analytics platform is designed specifically to handle these amounts of data.

This how-to will teach you how to do the following:

  • Sign up for the TimeSeries Connector
  • Configure the module settings
  • Create an asset
  • Create a channel
  • Store measurements
  • Implement the actions

2 Prerequisites

Before starting this how-to, make sure you have completed the following prerequisites:

3 Sign Up for the TimeSeries Connector

Follow these steps to get access to the TimeSeries connector and receive an API key:

  1. Sign up for the connector by going to the TimeSeries Connector website and registering for free. You will receive your API key in an email after registering.
  1. After you receive the key, import the TimeSeries connector into your app from the Mendix Marketplace.

4 Configure the Module Settings

After importing the module, there are a couple of settings you need to configure. Some of the settings are preconfigured.

4.1 Set the Constants

There are three constants that you can configure. Follow these steps to configure them:

  1. Expand the App Explorer and go to Marketplace modules > TimeSeriesConnector > Settings.
  2. Open the TimeSeriesAccessKey constant.
  3. Paste your TimeSeries API key in the Default value field and click OK.

4.2 Available Enumerations

These are the available enumerations in the TimeSeriesConnector module:

  • Enum_AggregationIntervalINTERVAL or REGISTER – these are determined by the TimeSeries platform and are the supported interval types for aggregation calls
  • Enum_AggregationPeriod – hourly, daily, weekly, monthly, and yearly are the supported time periods
  • Enum_MeasurementTypeINTERVAL, REGISTER, or EVENT – these are determined by the TimeSeries platform and are the only supported measurement types (note that measurements of the EVENT type cannot be aggregated)
  • Enum_SearchType – Purely for UI. These are used to determine which search to perform

5 Implementation Example

Let’s take the concept of a house. In this scenario the house is an asset, of which you can have multiple. This house will use gas and electricity, which we call channels. Each channel can hold values over time; electricity usage is measured and saved every X seconds, minutes, hours, and so on. These measurements can later be used for analysis.

The module comes with a ready-to-use domain model, which will be used in this how-to. This is not a necessity, and you can also use your own domain model. All referenced microflows in this how-to can also be found in the module.

The domain model looks like this:

5.1 Creating an Asset

You start the implementation by creating an asset object in a page, or directly in a microflow.

  1. Provide an Asset name, otherwise the connector will return an error. You are free to choose the name.

In our example implementation, we have created a page with an Asset object on which the attributes can be set. The ID is grayed out because it will be returned by the connector later in this process.

After having set the Asset name, we trigger some validation, call the Create asset action, and save the Asset ID for later references. Reference the microflow below:

5.2 Creating a Channel

The next step is creating a Channel. This Channel should belong to an Asset. Follow these steps to create a Channel:

  1. Provide an Asset ID to make sure your channel belongs to an asset.
  2. Provide a Channel key.
  3. Provide a Measurement interval.

In our example implementation we have created a page with a Channel object, on which the attributes and the association with an asset can be set.

After having set the necessary attributes and associations, we trigger some validation and call the Add channel action. This action will return a Boolean, specifying if the action was successful. Reference the microflow below:

5.3 Storing Measurement(s)

Now that you have created an asset with a channel, you can start storing measurements. Follow these steps to store your measurements:

  1. Make sure your measurement belongs to a channel (and thus, an asset).
  2. Provide the Date and time of the measurement.
  3. Provide the Measurement type.
  4. Provide the Value.

In our example implementation we have created a page with a measurement object, on which the attributes and the associations with an Asset and Channel can be set.

After having set the necessary attributes and associations, we trigger some validation and call the Store measurement action. This action will return a Boolean, which is not used. Reference the microflow below:

5.4 Aggregating Your Data

Once your channel has sufficient data, the TimeSeries Connector will really start to shine. Instead of having enormous amounts of data in your database, which takes a long time to aggregate for reporting, you can now simply ask the TimeSeries platform for an aggregation of your data. Follow these steps to set up your data aggregation:

  1. Create an AggregateSearchResult object to use as the Type parameter. If you create a new entity, make sure it has all the necessary attributes as defined in this example:

  1. Provide the empty Type parameter used to populate the results.
  2. Provide the Asset ID and Channel key to aggregate in.
  3. Provide a Start date and End date in epoch/unix time.
  4. Provide an Aggregation period, such as hourly or daily, in the correct ISO format.
  5. Provide the Timezone in which the results will be aggregated.
  6. Provide the Measurement type in which the measurements have been stored.

In our example implementation we have created a page with an AggregateSearch object, on which the search values and the associations with an asset and channel can be set.

After having set the necessary attributes and associations, we trigger some validation, prepare the data, and call the Aggregate between timestamps action. This action will return a list of your type parameter, AggregateSearchResult. This list contains an aggregation of the channel data by the aggregation period specified. For example: From March 1st up to March 10th, you will receive a list of your total electricity usage per day. This means your list will hold 10 objects. Reference the microflow below:

6 Conclusion

This how-to provides an example on how to implement a basic subset of the available actions. Over time, more actions will be released.

This how-to was written by Paul Ketelaars and Willem van Zantvoort. If you have any questions, please contact Paul Ketelaars at or Willem van Zantvoort at