Cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to invoke MindSphere IoT Time Series Aggregates Service with "hour" time interval unit

Experimenter
Experimenter

I am trying to invoke IoT Time Series Aggregates Service REST APIs via POSTMAN. I was able to get results for the below API request

https://southgate.eu1.mindsphere.io/api/iottimeseries/v3/aggregates/<assetID>/<aspectName>?from=2019-03-14T15:00:00Z&to=2019-03-19T15:00:00Z&select=<variableName>&intervalUnit=minute&intervalValue=60

my question is, Is it possible to get the same response by using the last two query params as "intervalUnit=hour&intervalValue=1" ? When I tried it below error was given.

{
    "timestamp": "2019-03-19T05:11:19.486Z",
    "status": 400,
    "error": "Bad Request",
    "exception": "com.siemens.mindsphere.iot.exception.IotException",
    "message": "[6009] Start time[2019-03-14T15:00:00Z] is not interval aligned[2019-03-14T14:30:00Z]."
}

thanks in advance

6 REPLIES 6

Re: Unable to invoke MindSphere IoT Time Series Aggregates Service with "hour" time interv

Legend
Legend

I'm assuming that you are sitting in an Indian time zone, with 30 minutes off UTC times. I'm not sure if this is a bug or intended behaviour in MindSphere, but since the requested interval unit is "hours", and your actual time is using a higher precision in "minutes", this probably triggers what is documented as an invalid query:
https://developer.mindsphere.io/apis/iot-iottsaggregates/api-iottsaggregates-overview.html#interval-...

Also from the samples:

https://developer.mindsphere.io/apis/iot-iottsaggregates/api-iottsaggregates-samples.html#defining-s...

14:30 16:30 1 hour - Rejected - start and end times defined with higher precision than interval length



This somehow contradicts what is stated in the documentation, but I'm not sure. Some mdsp dev should give a proper answer.
https://developer.mindsphere.io/apis/iot-iottsaggregates/api-iottsaggregates-overview.html#limitatio...

Re: Unable to invoke MindSphere IoT Time Series Aggregates Service with "hour" time interv

Experimenter
Experimenter

Thanks for the reply. In my request, time range is defined as from=2019-03-14T15:00:00Z&to=2019-03-19T15:00:00Z which is an exact multiplication of the time range in hours. Is this still considered as a higher precision than interval length ? 

Re: Unable to invoke MindSphere IoT Time Series Aggregates Service with "hour" time interv

Legend
Legend

Yes, I understand that. But (please correct me if I'm wrong) you seem to be sitting in the Indian timezone +05:30. I'm wondering if that could have a (buggy) effect, even if the documentation says that the zone should be supported.

 

I'm making this guess because of the error you get complains about a 30 minutes offset:

 

"message": "[6009] Start time[2019-03-14T15:00:00Z] is not interval aligned[2019-03-14T14:30:00Z

 

I did a test on my end with the same query parameters (I'm in a European tz) and I can't reproduce the behaviour you get, it works properly for me.

 

Another thing, you are using the "southgate..." url in your sample, why? Afaik you should be using either your own cloudfoundry backend, or the gateway one.

Re: Unable to invoke MindSphere IoT Time Series Aggregates Service with "hour" time interv

Experimenter
Experimenter

yes I am using the Indian time zone as I'm working form Colombo, Sri Lanka and yes in the documentation it's specifically mentioned as a supported. Simialarly I have tried the same requested after replacing the "southgate..." url with "gateway..." but still facing the same problem.

Are you suggesting that this time zone change is a bug from the MindSphere's end ?

 

I have opened a support ticked from the MindSphere end and posted this on the technical channel in the Slack as well but still no proper solution is suggested. Appreciate your support in this query. 

Re: Unable to invoke MindSphere IoT Time Series Aggregates Service with "hour" time interv

Legend
Legend
I don't know if this is a bug, but looks suspicious, and I personally couldn't reproduce it in a different, hour-aligned timezone. The community (and I) would be grateful if you'd share what the MindSphere team answers to your ticket support :-)

Re: Unable to invoke MindSphere IoT Time Series Aggregates Service with "hour" time interv

Experimenter
Experimenter

The support team was able to reproduce this issue and they are suggesting this is generated due to the Indian timezone that I am working on. They have suggested to use devices created on 'other' timezones and verify this and I am currently working on that. I will share the details ones the research is done. Thanks for your reply.