GDM JSON Schema¶
Flow¶
On-site, only base GDM is used.
graph LR
subgraph Site
S1[Maschine 1]
S2[Maschine 2]
A[IoT Agent]
M1[Module 1]
M2[Module 2]
S1 -->|<strong>GDM-BASE</strong>| M1
S2 -->|<strong>PAYLOAD</strong>| M2
M1 -->|<strong>GDM-BASE</strong>| A
M2 -->|<strong>GDM-BASE</strong>| A
end
The agent then adds some properties to GDM.
graph LR
MP[Message Processing]
SI[Site]
SI -->|<strong>GDM-EDGE</strong>| MP
Finally, the message processing pipeline adds properties to the GDM message which is now in cloud GDM format.
graph LR
subgraph Message Processing
B[IoT Hub]
I[Ingestion]
T1[Tenant]
T2[Other Tenant]
KO[Kusto Outputter]
DO[Datalake Outputter]
I --> |<strong>GDM-CLOUD</strong>| T1
I -.-> |<strong>GDM-CLOUD</strong>| T2
T1 --> KO
T1 -.-> DO
B --> I
end
Schema Specifications¶
Base¶
This schema is used for messages created before they arrive at the IoT Gateway.
{
"$id": "http://schema.buhlergroup.io/release-01/gdm-base.json",
"type": "object",
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"deviceId": {
"$id": "/properties/deviceId",
"type": "string",
"pattern": "^[a-zA-Z0-9_\\-.#=]+$",
"title": "Identifier for a device.",
"description": "The name of a device that sending to an agent or to directly to Azure IoT Hub. When using behind a IoT Gateway, this value MUST be unique per agent.",
"examples": [
"Machine-01",
"My_Machine-0.2"
]
},
"messageId": {
"$id": "/properties/messageId",
"type": "string",
"pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$",
"title": "Globally unique Id for a message.",
"maxLength": 36,
"description": "",
"examples": [
"f1d9d4c7-f790-4c8d-8902-8becf049c6fd"
]
},
"messageType": {
"$id": "/properties/messageType",
"type": "string",
"pattern": "^(state|alarm|notification|fileupload|configuration)(:{1}[a-zA-Z0-9_\\-.]+)?$",
"title": "Type of the message with optional custom type information.",
"description": "",
"default": "state",
"examples": [
"state",
"alarm",
"notification",
"fileupload",
"configuration",
"state:SFLF-Standard_State_3600_v1.5",
"alarm:SZAP-Standard_Alarm_v1.5"
]
},
"messageVersion": {
"$id": "/properties/messageVersion",
"type": "string",
"pattern": "^\\d+\\.\\d+(\\.\\d+)?$",
"title": "Message version",
"description": "",
"default": "1.0",
"examples": [
"1.0"
]
},
"metadata": {
"$id": "/properties/metadata",
"type": "object",
"title": "Message metadata",
"examples": [
{
"useCaseSpecific01": "ValueA"
}
]
},
"data": {
"$id": "/properties/data",
"type": "array",
"items": {
"$id": "/properties/data/items",
"type": "object",
"properties": {
"name": {
"$id": "/properties/data/items/properties/name",
"type": "string",
"pattern": "^.+$",
"title": "Name of the data item.",
"examples": [
"MainYield"
]
},
"metadata": {
"$id": "/properties/data/items/properties/metadata",
"type": "object",
"title": "Additional metadata for data item.",
"examples": [
{
"unit": "°C"
}
]
},
"values": {
"$id": "/properties/data/items/properties/values",
"type": "array",
"items": {
"$id": "/properties/data/items/properties/values/items",
"type": "object",
"properties": {
"deviceTimestamp": {
"$id": "/properties/data/items/properties/values/items/properties/deviceTimestamp",
"type": [
"string",
"null"
],
"format": "date-time",
"title": "Device timestamp in ISO 8601 and UTC offset.",
"description": "",
"default": "",
"examples": [
"2017-10-16T06:33:54Z",
"2017-10-16T06:33:54.500+01:00",
"2017-10-16T06:33:54.500123-03:00"
]
},
"value": {
"$id": "/properties/data/items/properties/values/items/properties/value",
"type": [
"string",
"integer",
"number",
"boolean",
"array",
"null"
],
"title": "Value",
"description": "",
"default": 0,
"examples": [
95.820640563964844
]
}
},
"required": [
"value"
]
}
}
},
"required": [
"name",
"values"
]
}
}
},
"required": [
"messageId",
"messageType",
"messageVersion"
]
}
{
"deviceId": "Pony_Hof-0.1",
"messageId": "d32779a6-9b8e-4fa0-9941-9a147040f24a",
"messageType": "state",
"messageVersion": "1.0",
"data": [
{
"name": "ABC_DEF_xyz",
"values": [
{
"value": 95.82064
}
]
}
]
}
{
"deviceId": "Pony_Hof-0.1",
"messageId": "d32779a6-9b8e-4fa0-9941-9a147040f24a",
"messageType": "state",
"messageVersion": "1.0",
"metadata": {
"plantId": "123123",
"useCaseSpecific01": "ValueA",
"useCaseSpecific02": "ValueB"
},
"data": [
{
"name": "ABC_DEF_xyz",
"metadata": {
"equipmentId": "321321",
"unit": "%",
"type": "Double",
"useCaseSpecific01": "ValueA",
"useCaseSpecific02": "ValueB"
},
"values": [
{
"deviceTimestamp": "2017-10-16T06:32:54.500Z",
"value": 95.82064
},
{
"deviceTimestamp": null,
"value": 101.54941
},
{
"value": 94.98477
}
]
},
{
"name": "CurrentPowerUsage",
"metadata": {
"equipmentId": "321321",
"useCaseSpecific01": "ValueA",
"useCaseSpecific02": "ValueB"
},
"values": [
{
"deviceTimestamp": "2017-10-16T06:32:54.500Z",
"value": 542.4725
},
{
"deviceTimestamp": null,
"value": 488.7299
},
{
"value": 477.3551
}
]
}
]
}
{
"deviceId": "Pony_Hof-0.1",
"messageId": "d32779a6-9b8e-4fa0-9941-9a147040f24a",
"messageType": "alarm",
"messageVersion": "1.0",
"metadata": {
"plantId": "123123",
"useCaseSpecific01": "ValueA",
"useCaseSpecific02": "ValueB"
},
"data": [
{
"name": "M0019",
"metadata": {
"equipmentId": "321321",
"text": "Cilindros sueltos",
"active": true,
"state": "Unacknowledged",
"acknowledged": false,
"reason": "This is a reason for an alarm message",
"severity": "Error"
},
"values": [
{
"deviceTimestamp": "2017-10-16T06:32:54.500Z",
"value": null
}
]
},
{
"name": "MotorTempExceeded",
"metadata": {
"equipmentId": "321321",
"unit": "°C",
"text": "The temperature of the motor has reached its maximum and will explode in the next hours",
"active": true,
"state": "Free-Text",
"severity": "Error"
},
"values": [
{
"deviceTimestamp": "2017-10-16T06:32:54.500Z",
"value": null
}
]
}
]
}
{
"deviceId": "Pony_Hof-0.1",
"messageId": "d32779a6-9b8e-4fa0-9941-9a147040f24a",
"messageType": "notification",
"messageVersion": "1.0",
"metadata": {
"plantId": "123123",
"useCaseSpecific01": "ValueA",
"useCaseSpecific02": "ValueB"
},
"data": [
{
"name": "ShutdownEvent",
"metadata": {
"equipmentId": "321321",
"text": "Shutdown event received."
},
"values": [
{
"deviceTimestamp": "2017-10-16T06:32:54.500Z",
"value": null
}
]
}
]
}
{
"deviceId": "Pony_Hof-0.1",
"messageId": "d32779a6-9b8e-4fa0-9941-9a147040f24a",
"messageType": "configuration",
"messageVersion": "1.0",
"metadata": {
"plantId": "123123",
"useCaseSpecific01": "ValueA",
"useCaseSpecific02": "ValueB"
},
"data": [
{
"name": "myConfigKey_01",
"values": [
{
"value": "myValue"
}
]
},
{
"name": "myConfigKey_02",
"values": [
{
"value": "myValue2"
}
]
}
]
}
{
"deviceId": "Pony_Hof-0.1",
"messageId": "d32779a6-9b8e-4fa0-9941-9a147040f24a",
"messageType": "fileupload",
"messageVersion": "1.0",
"metadata": {
"correlationId": "0b9adc8c-8957-4582-a2dc-c042acb21b82",
"blobSasUri": "https://iothubname.azure-devices.net/devices/c5073485-fddd-4e7e-a2fb-69b747e53d55/files/my-file.jpg?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D",
"useCaseSpecific02": "ValueB"
},
"data": [
]
}
Edge¶
This schema is used for messages created at the IoT Gateway.
{
"$id": "http://schema.buhlergroup.io/release-01/gdm-edge.json",
"type": "object",
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"deviceId": {
"$id": "/properties/deviceId",
"type": "string",
"pattern": "^[a-zA-Z0-9_\\-.#=]+$",
"title": "Identifier for a device.",
"description": "The name of a device that sending to an agent or to directly to Azure IoT Hub. When using behind a IoT Gateway, this value MUST be unique per agent.",
"examples": [
"Machine-01",
"My_Machine-0.2"
]
},
"agentTimestamp": {
"$id": "/properties/agentTimestamp",
"type": "string",
"format": "date-time",
"title": "Agent timestamp in ISO 8601 and UTC offset.",
"description": "This value MUST be set by IoT Gateway.",
"examples": [
"2017-10-16T06:33:54Z",
"2017-10-16T06:33:54.500+01:00",
"2017-10-16T06:33:54.500123-03:00"
]
},
"messageId": {
"$id": "/properties/messageId",
"type": "string",
"pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$",
"title": "Globally unique Id for a message.",
"maxLength": 36,
"description": "",
"examples": [
"f1d9d4c7-f790-4c8d-8902-8becf049c6fd"
]
},
"messageType": {
"$id": "/properties/messageType",
"type": "string",
"pattern": "^(state|alarm|notification|fileupload|configuration)(:{1}[a-zA-Z0-9_\\-.]+)?$",
"title": "Type of the message with optional custom type information.",
"description": "",
"default": "state",
"examples": [
"state",
"alarm",
"notification",
"fileupload",
"configuration",
"state:SFLF-Standard_State_3600_v1.5",
"alarm:SZAP-Standard_Alarm_v1.5"
]
},
"messageVersion": {
"$id": "/properties/messageVersion",
"type": "string",
"pattern": "^\\d+\\.\\d+(\\.\\d+)?$",
"title": "Message version",
"description": "",
"default": "1.0",
"examples": [
"1.0"
]
},
"metadata": {
"$id": "/properties/metadata",
"type": "object",
"title": "Message metadata",
"examples": [
{
"useCaseSpecific01": "ValueA"
}
]
},
"data": {
"$id": "/properties/data",
"type": "array",
"items": {
"$id": "/properties/data/items",
"type": "object",
"properties": {
"name": {
"$id": "/properties/data/items/properties/name",
"type": "string",
"pattern": "^.+$",
"title": "Name of the data item.",
"examples": [
"MainYield"
]
},
"metadata": {
"$id": "/properties/data/items/properties/metadata",
"type": "object",
"title": "Additional metadata for data item.",
"examples": [
{
"unit": "°C"
}
]
},
"values": {
"$id": "/properties/data/items/properties/values",
"type": "array",
"items": {
"$id": "/properties/data/items/properties/values/items",
"type": "object",
"properties": {
"deviceTimestamp": {
"$id": "/properties/data/items/properties/values/items/properties/deviceTimestamp",
"type": [
"string",
"null"
],
"format": "date-time",
"title": "Device timestamp in ISO 8601 and UTC offset.",
"description": "",
"default": "",
"examples": [
"2017-10-16T06:33:54Z",
"2017-10-16T06:33:54.500+01:00",
"2017-10-16T06:33:54.500123-03:00"
]
},
"value": {
"$id": "/properties/data/items/properties/values/items/properties/value",
"type": [
"string",
"integer",
"number",
"boolean",
"array",
"null"
],
"title": "Value",
"description": "",
"default": 0,
"examples": [
95.820640563964844
]
}
},
"required": [
"value"
]
}
}
},
"required": [
"name",
"values"
]
}
}
},
"required": [
"deviceId",
"agentTimestamp",
"messageId",
"messageType",
"messageVersion"
]
}
{
"deviceId": "Pony_Hof-0.1",
"agentTimestamp": "2017-10-16T06:34:19.046Z",
"messageId": "d32779a6-9b8e-4fa0-9941-9a147040f24a",
"messageType": "state",
"messageVersion": "1.0",
"data": [
{
"name": "ABC_DEF_xyz",
"values": [
{
"value": 94.98477
}
]
}
]
}
{
"deviceId": "Pony_Hof-0.1",
"agentTimestamp": "2017-10-16T06:34:19.046Z",
"messageId": "d32779a6-9b8e-4fa0-9941-9a147040f24a",
"messageType": "state",
"messageVersion": "1.0",
"metadata": {
"plantId": "123123",
"useCaseSpecific01": "ValueA",
"useCaseSpecific02": "ValueB"
},
"data": [
{
"name": "ABC_DEF_xyz",
"metadata": {
"equipmentId": "321321",
"unit": "%",
"type": "Double",
"useCaseSpecific01": "ValueA",
"useCaseSpecific02": "ValueB"
},
"values": [
{
"deviceTimestamp": "2017-10-16T06:32:54.500Z",
"value": 95.82064
},
{
"deviceTimestamp": null,
"value": 101.54941
},
{
"value": 94.98477
}
]
},
{
"name": "CurrentPowerUsage",
"metadata": {
"equipmentId": "321321",
"useCaseSpecific01": "ValueA",
"useCaseSpecific02": "ValueB"
},
"values": [
{
"deviceTimestamp": "2017-10-16T06:32:54.500Z",
"value": 542.4725
},
{
"deviceTimestamp": null,
"value": 488.7299
},
{
"value": 477.3551
}
]
}
]
}
Cloud¶
This schema is used for messages created at the Bühler IoT Platform.
{
"$id": "http://schema.buhlergroup.io/release-01/gdm-cloud.json",
"type": "object",
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"uid": {
"$id": "/properties/uid",
"type": "string",
"pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}_([a-z0-9_\\-.]+)$",
"readOnly": true,
"title": "Globally unique Id for a device.",
"description": "This value is set by the platform and is the concatenation of the lowered AgentId and lowered DeviceId with an underscore in between.",
"examples": [
"736ef881-46d9-48af-b67a-9ea943261564_machine-01",
"736ef881-46d9-48af-b67a-9ea943261564_my_machine-0.2"
]
},
"deviceId": {
"$id": "/properties/deviceId",
"type": "string",
"pattern": "^[a-zA-Z0-9_\\-.#=]+$",
"title": "Identifier for a device.",
"description": "The name of a device that sending to an agent or to directly to Azure IoT Hub. When using behind a IoT Gateway, this value MUST be unique per agent.",
"examples": [
"Machine-01",
"My_Machine-0.2"
]
},
"agentId": {
"$id": "/properties/agentId",
"type": "string",
"pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$",
"readOnly": true,
"maxLength": 36,
"title": "Global unique Id for an agent.",
"description": "This value is set by the platform and represents the id of our agent and is also the DeviceId in the Azure IoT Hub.",
"examples": [
"736ef881-46d9-48af-b67a-9ea943261564"
]
},
"agentTimestamp": {
"$id": "/properties/agentTimestamp",
"type": "string",
"format": "date-time",
"title": "Agent timestamp in ISO 8601 and UTC offset.",
"description": "This value MUST be set by IoT Gateway.",
"examples": [
"2017-10-16T06:33:54Z",
"2017-10-16T06:33:54.500+01:00",
"2017-10-16T06:33:54.500123-03:00"
]
},
"ingestionId": {
"$id": "/properties/ingestionId",
"type": "string",
"pattern": "^[a-zA-Z0-9_\\-.]+$",
"readOnly": true,
"title": "Name of the Azure IoT Hub.",
"description": "This value is set by the platform.",
"examples": [
"buhler-we-prod-telemetry"
]
},
"ingestionTimestamp": {
"$id": "/properties/ingestionTimestamp",
"type": "string",
"format": "date-time",
"readOnly": true,
"title": "Ingestion timestamp in ISO 8601 and UTC offset.",
"description": "This value is set by the platform.",
"examples": [
"2017-10-16T06:33:54Z",
"2017-10-16T06:33:54.500+01:00",
"2017-10-16T06:33:54.500123-03:00"
]
},
"messageId": {
"$id": "/properties/messageId",
"type": "string",
"pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$",
"title": "Globally unique Id for a message.",
"maxLength": 36,
"description": "",
"examples": [
"f1d9d4c7-f790-4c8d-8902-8becf049c6fd"
]
},
"messageType": {
"$id": "/properties/messageType",
"type": "string",
"pattern": "^(state|alarm|notification|fileupload|configuration)(:{1}[a-zA-Z0-9_\\-.]+)?$",
"title": "Type of the message with optional custom type information.",
"description": "",
"default": "state",
"examples": [
"state",
"alarm",
"notification",
"fileupload",
"configuration",
"state:SFLF-Standard_State_3600_v1.5",
"alarm:SZAP-Standard_Alarm_v1.5"
]
},
"messageVersion": {
"$id": "/properties/messageVersion",
"type": "string",
"pattern": "^\\d+\\.\\d+(\\.\\d+)?$",
"title": "Message version",
"description": "",
"default": "1.0",
"examples": [
"1.0"
]
},
"metadata": {
"$id": "/properties/metadata",
"type": "object",
"title": "Message metadata",
"examples": [
{
"useCaseSpecific01": "ValueA"
}
]
},
"data": {
"$id": "/properties/data",
"type": "array",
"items": {
"$id": "/properties/data/items",
"type": "object",
"properties": {
"nameId": {
"$id": "/properties/data/items/properties/nameId",
"type": "string",
"pattern": "^[a-f0-9]{64}$",
"readOnly": true,
"maxLength": 64,
"title": "Globally unique Id for an data item.",
"description": "Calculated with: lowercase(sha256(<AgentId>_<DeviceId>_<Name>))",
"examples": [
"28870beefcc699657a0864f57212a5ebf21d7a4aae5f36f905eb1cf2ef1e343f",
"ff2d65eb76ec2e04cd5278d1a9eda0623692c406b003e3b872a39c59b06ece10"
]
},
"name": {
"$id": "/properties/data/items/properties/name",
"pattern": "^.+$",
"type": "string",
"title": "Name of the data item.",
"examples": [
"MainYield"
]
},
"metadata": {
"$id": "/properties/data/items/properties/metadata",
"type": "object",
"title": "Additional metadata for data item.",
"examples": [
{
"unit": "°C"
}
]
},
"values": {
"$id": "/properties/data/items/properties/values",
"type": "array",
"items": {
"$id": "/properties/data/items/properties/values/items",
"type": "object",
"properties": {
"deviceTimestamp": {
"$id": "/properties/data/items/properties/values/items/properties/deviceTimestamp",
"type": [
"string",
"null"
],
"format": "date-time",
"title": "Device timestamp in ISO 8601 and UTC offset.",
"description": "",
"default": "",
"examples": [
"2017-10-16T06:33:54Z",
"2017-10-16T06:33:54.500+01:00",
"2017-10-16T06:33:54.500123-03:00"
]
},
"value": {
"$id": "/properties/data/items/properties/values/items/properties/value",
"type": [
"string",
"integer",
"number",
"boolean",
"array",
"null"
],
"title": "Value",
"description": "",
"default": 0,
"examples": [
95.820640563964844
]
}
},
"required": [
"value"
]
}
}
},
"required": [
"nameId",
"name",
"values"
]
}
}
},
"required": [
"uid",
"deviceId",
"agentId",
"agentTimestamp",
"ingestionId",
"ingestionTimestamp",
"messageId",
"messageType",
"messageVersion"
]
}
{
"uid": "5906a319-d219-4921-b624-bd4951fbaed0_Pony_Hof-0.1",
"deviceId": "Pony_Hof-0.1",
"agentId": "5906a319-d219-4921-b624-bd4951fbaed0",
"agentTimestamp": "2017-10-16T06:34:19.046Z",
"ingestionId": "Name-of_IoT.Hub",
"ingestionTimestamp": "2017-10-16T06:34:19.046Z",
"messageId": "d32779a6-9b8e-4fa0-9941-9a147040f24a",
"messageType": "state",
"messageVersion": "1.0",
"data": [
{
"nameId": "28870beefcc699657a0864f57212a5ebf21d7a4aae5f36f905eb1cf2ef1e343f",
"name": "ABC_DEF_xyz",
"values": [
{
"value": 94.98477
}
]
}
]
}
{
"uid": "5906a319-d219-4921-b624-bd4951fbaed0_Pony_Hof-0.1",
"deviceId": "Pony_Hof-0.1",
"agentId": "5906a319-d219-4921-b624-bd4951fbaed0",
"agentTimestamp": "2017-10-16T06:34:19.046Z",
"ingestionId": "Name-of_IoT.Hub",
"ingestionTimestamp": "2017-10-16T06:34:19.046Z",
"messageId": "d32779a6-9b8e-4fa0-9941-9a147040f24a",
"messageType": "state",
"messageVersion": "1.0",
"metadata": {
"plantId": "123123",
"useCaseSpecific01": "ValueA",
"useCaseSpecific02": "ValueB"
},
"data": [
{
"nameId": "28870beefcc699657a0864f57212a5ebf21d7a4aae5f36f905eb1cf2ef1e343f",
"name": "ABC_DEF_xyz",
"metadata": {
"equipmentId": "321321",
"unit": "%",
"type": "Double",
"useCaseSpecific01": "ValueA",
"useCaseSpecific02": "ValueB"
},
"values": [
{
"deviceTimestamp": "2017-10-16T06:32:54.500Z",
"value": 95.82064
},
{
"deviceTimestamp": null,
"value": 101.54941
},
{
"value": 94.98477
}
]
},
{
"nameId": "ff2d65eb76ec2e04cd5278d1a9eda0623692c406b003e3b872a39c59b06ece10",
"name": "CurrentPowerUsage",
"metadata": {
"equipmentId": "321321",
"useCaseSpecific01": "ValueA",
"useCaseSpecific02": "ValueB"
},
"values": [
{
"deviceTimestamp": "2017-10-16T06:32:54.500Z",
"value": 542.4725
},
{
"deviceTimestamp": null,
"value": 488.7299
},
{
"value": 477.3551
}
]
}
]
}
{"environments":[],"pdf-download":true}