Is it possible to fetch aggregated measurement data using the REST api or the c8y.sdk javascript module from Cumulocity. The use case here would be that I would like to fetch measurements for a given time frame so that there would be one measurement result for every 5 minute timebox regardless of the actual measurement frequency?
Asked
Active
Viewed 331 times
2 Answers
2
On REST you can query like this for aggregation:
/measurement/measurements/series?aggregationType={{aggregationType}}&dateFrom={{dateFrom}}&dateTo={{dateTo}}&source={{source}}
Supported aggregation types are: MINUTELY, HOURLY, DAILY
The response contains min and max for all measurements of the device for each aggregation period in the given time range.
You cannot define your own aggregation time using this API.
If you need a 5 min aggregation you can always create an event processing module that creates this aggregation as a new measurement and then query it via the normal measurement REST API

TyrManuZ
- 2,039
- 1
- 14
- 23
-
Is this only possible through the REST api, or is it also supported in the c8y.sdk ? – severi May 18 '16 at 07:21
0
The c8y.sdk is built on top of the REST API, so it's perfectly possible to fetch the measurement created by the event processing rule using the sdk.

Piotr Jaworski
- 584
- 1
- 5
- 20