Sensors Data
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.
Configuration
To connect sensor values with 3D spaces, visit this course page:
Swagger Sensors Section
POST endpoints
The Swagger Sensors section provides a detailed description of the API for sensor data. There are two main POST 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.
Twinzo handles both use cases same and unifies features for both methods. Use the method accordingly to your needs and requirements. Every single sensor can group multiple different quantities.
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.
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
}
]
}
]
Â
PATCH endpoint
PATCH update sensors, do not use for update sensors data! For update data use endpoints descirbet above.
PATCH /sensors/{id}
Used to update sensors
Example
PATCH Sensors update already exists sensor
PATCH Shifts
[
{
"Title": "New Title"
}
]
Â
Â
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"
If you encounter any issues or need assistance with using this product, please do not hesitate to reach out for support. Our team is here to help you resolve any problems and answer any questions you may have.
To create a support ticket, visit our support portal at https://partner.twinzo.eu/helpdesk/customer-care-1