Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

This guide describes how to integrate and send sensor data to twinzo's REST API. twinzo's API enables seamless integration of various sensors for diverse use cases like temperature, humidity, OEE, KPIs, produced pcs, parking slots, and more. By integrating sensors with twinzo, users can create a digital twin of their physical environment, which provides valuable insights into operational efficiency, asset utilization, and productivity.

https://www.youtube.com/watch?v=4yUc4Zf0s0Q

Configuration

To connect sensor values with 3D spaces, visit this course page:

Swagger Sensors Section

The Swagger Sensors section provides a detailed description of the API for sensor data. There are two main endpoints in the Sensors section:

/sensors/sensor-data

  • Used when the sensor sends data on its own.

  • The sensor uses login/password to obtain an OAuth token, which is then signed.

/sensors/batch

  • Used when the API, middleware, edge computer sends data for multiple sensors.

  • An array of sensors is sent, each identified using Login.

  • A static API key is used for signing.

Example

Sensor data send and batch data send are two different ways of transmitting data from sensors to a server or an application.

Sensor data send is when each sensor sends its own data independently, without waiting for other sensors or devices.

Batch data send is when multiple sensors or devices synchronize their data and send it together, either through an API or an edge device.

Twinzo handles both use cases same and unifies features for both methods. Use the method accordingly to your needs and requirements. Each sensor can group multiple different quantities.

Sensor data

[
  {
    "Timestamp": 0,
    "Quantity": "string",
    "Value": "string",
    "Unit": "string",
    "DataType": "string",
    "ValueOK": true
  }
]

Batch data

[
  {
    "Login": "YourLogin",
    "SensorData": [
      {
        "Timestamp": 1615381099861,
        "Quantity": "Temperature",
        "Value": "10",
        "Unit": "°C",
        "DataType": "Int32",
        "ValueOK": true
      }
    ]
  }
]

Data Properties

Data payload JSON object that contains an array of objects. Each object has six properties:

Login

Sensor login field (used as a unique identifier in the batch data POST).

Timestamp

A Unix timestamp in milliseconds that represents the time when the data was collected.

Quantity

A string that represents the quantity of data collected.

Value

A string that represents the value of the data collected.

Unit

A string that represents the unit of measurement for the data collected.

DataType

A string that represents the type of data collected.

ValueOK

A boolean value that indicates whether or not the value of the data collected is valid. If not valid, the sensor will be highlighted in the 3D application.

Data types

The following data types are supported by twinzo's API:

  • Byte, SByte

  • Int32, UInt32, Int16, UInt16, Int64, UInt64

  • Single, Double, Decimal

  • Char, String

  • Boolean

  • DateTime

Every value is passed to the JSON object as a string in parenthesis. Twinzo API parses value according to the data type specified. The default data type is String. For example, Boolean and numeric values will look like this:

  • "Value": "true"

  • "Value": "123"

  • No labels