How to fetch the measurements from MeasurementRepresentation as returned by the /measurement/measurements/series API which returns the min max values?

What product/components do you use and which version/fix level?

Cumulocity sdk

Are you using a free trial or a product with a customer license?

customer license

What are trying to achieve? Please describe in detail.

I am using the MeasurementRepresentation sdk of cumulocity for fetching the measurements. My logic previously was based on fetching the measurements from /measurement/measurements/series API using Java RestTemplate.

Now I am using the measurementrepresentation sdk to fetch the measurements which is returning the response as that of the response from normal /measurement/measurements API. (measurementApi.getMeasurementsByFilter(filter) )

“measurements”: [
{
“self”: “https://t54905.iot.solenis.com/measurement/measurements/4109625”,
“time”: “2022-07-06T12:38:04.221Z”,
“id”: “4109625”,
“source”: {
“self”: “https://t54905.iot.solenis.com/inventory/managedObjects/105245”,
“id”: “105245”
},
“type”: “sol_onguardMeasurement”,
“Temp”: {
“unit”: “T”,
“value”: “36”
}
},
{
“self”: “https://t54905.iot.solenis.com/measurement/measurements/4108354”,
“time”: “2022-07-06T12:38:04.221Z”,
“id”: “4108354”,
“source”: {
“self”: “https://t54905.iot.solenis.com/inventory/managedObjects/105245”,
“id”: “105245”
},
“type”: “sol_onguardMeasurement”,
“Cond”: {
“unit”: “mV”,
“value”: “110”
}
}
]

How to fetch the measurements as returned by the /measurement/measurements/series API which returns the min max values?

   "2022-06-07T05:00:00.000Z": [
        {
            "min": 0.23,
            "max": 0.23
        },
        {
            "min": 0.0,
            "max": 0.0
        },
        {
            "min": 0.7,
            "max": 0.7
        },
        {
            "min": 57.7,
            "max": 57.7
        },
        {
            "min": 0.0,
            "max": 0.0
        },
        {
            "min": 69.7,
            "max": 69.7
        },
        {
            "min": 28.8,
            "max": 28.8
        },
        {
            "min": 0.0,
            "max": 0.0
        },
        {
            "min": 0.0,
            "max": 0.0
        },
        {
            "min": 0.0,
            "max": 0.0
        },
        {
            "min": 7.37,
            "max": 7.37
        },
        {
            "min": 215.5,
            "max": 215.5
        },
        {
            "min": 33.5,
            "max": 33.5
        },
        {
            "min": 4357.0,
            "max": 4357.0
        },
        {
            "min": 21.5,
            "max": 21.5
        },
        {
            "min": 0.0,
            "max": 0.0
        },
        {
            "min": 100.0,
            "max": 100.0
        },
        {
            "min": 0.0,
            "max": 0.0
        },
        {
            "min": 0.0,
            "max": 0.0
        },
        {
            "min": 100.0,
            "max": 100.0
        },
        {
            "min": 100.0,
            "max": 100.0
        },
        {
            "min": 100.0,
            "max": 100.0
        },
        {
            "min": 100.0,
            "max": 100.0
        },
        {
            "min": 0.0,
            "max": 0.0
        },
        {
            "min": 0.0,
            "max": 0.0
        },
        {
            "min": 0.0,
            "max": 0.0
        },
        {
            "min": 0.0,
            "max": 0.0
        },
        {
            "min": 0.0,
            "max": 0.0
        },
        {
            "min": 0.0,
            "max": 0.0
        },
        {
            "min": 0.0,
            "max": 0.0
        },
        {
            "min": 0.01,
            "max": 0.01
        },
        {
            "min": 0.0,
            "max": 0.0
        },
        {
            "min": 100.0,
            "max": 100.0
        },
        {
            "min": 0.0,
            "max": 0.0
        }
    ]
},
"series": [
    {
        "unit": "mpy",
        "name": "CS_Corr_S41",
        "type": "sol_onguardMeasurement"
    },
    {
        "unit": "%",
        "name": "FCL_Rtrns_A24",
        "type": "sol_onguardMeasurement"
    },
    {
        "unit": "mpy",
        "name": "Cu_Corr_S43",
        "type": "sol_onguardMeasurement"
    },
    {
        "unit": "ppm",
        "name": "Tracker_S21",
        "type": "sol_onguardMeasurement"
    },
    {
        "unit": "%",
        "name": "Manual_A32",
        "type": "sol_onguardMeasurement"
    },
    {
        "unit": "°F",
        "name": "Temp_S12",
        "type": "sol_onguardMeasurement"
    },
    {
        "unit": "%",
        "name": "TRKR_Rtrns_A22",
        "type": "sol_onguardMeasurement"
    },
    {
        "unit": "%",
        "name": "pH_Rtrns_A23",
        "type": "sol_onguardMeasurement"
    },

Do you get any error messages? Please provide a full error message screenshot and log file.

Have you installed latest fixes for the products

Hi Sethu,

the Java SDK does not support the Series API. You will have to implement this using a REST call yourself. You can take a look at this post as well: Getting Measurement Series using C8y Java SDK

Best Regards,
Balpreet

Hi Balpreet,
Oh, I was confident that there is an equivalent sdk representation for series of measurements. Ok no problem, now i have to change my logic to fetch measurements in the java code too.

Thank you for letting me know at the earliest. Appreciate it

Regards,
P. Sethu pandia raja

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.