You are having difficulties with the deployment workflow to write a value to a data point.
How can you achieve this?
Solution
There are two ways to write the value to the device.
option 1: This is a recommended option.
1)
GET API:
https://gateway.eu1.mindsphere.io/api/mindconnectdevicemanagement/v3/devices/Assetid/dataConfig
This API is to get the data source id and data point id.
2)
Create a new job Instance (POST API)
https://gateway.eu1.mindsphere.io/api/deploymentworkflow/v3/instances
Here you need to provide the body.
Body:
{
"deviceId": "string",
"model": {
"key": "mdsp-core-commandDispatcher",
"customTransitions": []
},
"data": {
"type": "datapoint-write",
"createdBy": "user@company.com",
"to": "PROTOCOL_NAME",
"version": "v1.0",
"payload": {
"protocol": "PROTOCOL_NAME",
"desiredValue": "232",
"dataSourceId": "ID_OF_DS",
"dataPointId": "ID_OF_DP"
}
}
}
Option 2:
1)
GET API:
https://gateway.eu1.mindsphere.io/api/mindconnectdevicemanagement/v3/devices/Assetid/dataConfig
This API is to get the data source id and data point id.
2)
Post to write a data point (POST API)
Body:-
{
"dataSourceId": "ID_OF_DS",
"dataPointId": "ID_OF_DP",
"desiredValue": "4"
}
Notes