I'd like to take a consumption measurement every 1 minute, but upload every 15 minutes to Cumulocity, from my Option Cloudgate. So there would be a total of 15 measurements to upload, each with its own value and timestamp.
Would this be possible?
I'd like to take a consumption measurement every 1 minute, but upload every 15 minutes to Cumulocity, from my Option Cloudgate. So there would be a total of 15 measurements to upload, each with its own value and timestamp.
Would this be possible?
If you are using SmartREST this is just putting multiple rows in the request. However also via JSON REST it is possible (for measurements only at the moment)
Unfortunately it is lacking in the official documentation.
The REST request looks like this:
POST /measurement/measurements
Content-Type: application/vnd.com.nsn.cumulocity.measurementCollection+json
{
"measurements": [
{
"c8y_SpeedMeasurement": {
"speed": {
"value": 25,
"unit": "km/h" }
},
"time":"2013-06-22T17:03:14.000+02:00",
"source": {
"id":"10200" },
"type": "c8y_SpeedMeasurement"
},
{
"c8y_SpeedMeasurement": {
"speed": {
"value": 22,
"unit": "km/h" }
},
"time":"2013-06-22T17:05:14.000+02:00",
"source": {
"id":"10200" },
"type": "c8y_SpeedMeasurement"
}
]
}
So the format is like what you get when you query measurement collection. The important part is the Content-Type header. You mustn't use application/json because then it is expecting a single measurement.