Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Retrieving Sensor Data

...

Note

To understand, please look into chapter of sensor data format described here:
Sensors Data - Public Documentation - Confluence (atlassian.net)

Overview

You can use the Twinzo API to retrieve data from sensors. This API allows you to access data from various sensors installed in your system.

...

When retrieving data from the API, you can specify the time range for which you want data. Additionally, you can specify the aggregation level. The API will then determine the appropriate granularity for the retrieved data based on the duration of the specified time range and the aggregation level.

Aggregation Levels

Granularity refers to the level of detail at which data is retrieved from the API. It determines the size of time intervals into which the data will be aggregated.

The API supports the following granularity levels:

  • For time ranges from 0 seconds to 60 seconds: 1 second (1000 milliseconds)

  • For time ranges from 1 minute to 1 hour: 1 minute (60000 milliseconds)

  • For time ranges from 1 hour to 24 hours: 15 minutes (900000 milliseconds)

  • For time ranges from 1 day to 7 days: 1 hour (3600000 milliseconds)

  • For time ranges from 7 days to 4 months: 1 day (86400000 milliseconds)

  • For time ranges from 4 months to 5 years: 1 month (2592000000 milliseconds)

  • For time ranges greater than 5 years: 1 year (31536000000 milliseconds)

Example

For example, if you request data for a time range of 3 days and specify the aggregation level as "mean", the API will automatically aggregate the data into 1-hour intervals.

...

Code Block
languagejson
{
  "application/json": {
    "Quantity": "Temperature",
    "Unit": "Celsius",
    "DataType": "Int32",
    "Data": [
      {
        "Timestamp": 1714728346401,
        "Value": "30",
        "Aggregation": 600003600000
      }
    ]
  }
}

Explanation

In the response example above:

...