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=4yUc4Zf0s0QConfiguration
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
The message for sensor data is a JSON object that contains an array of objects. Each object has six properties:
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
Info |
---|
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:
|