IOT Sitewise Metric formula not computing

0

Hello everyone.

In a Industry 4.0 project involving various IOT sensors, in IOT Sitewise, we are using metrics based on measurements for each assets (those are then aggregated by higher assets in the hierarchy).

While we have values in our measurements, the formula of the metric seems to never compute as the output stays blank... Any idea why it could have this behaviour ? (see screenshots)

  • I tried changing the metric interval to 1minute and 1week without effect
  • The function is a simple "eq()" and the documentation warns that "This function doesn't return a value if x and y are incompatible types, such as a number and a string.", but we are working with boolean on both sides.
  • I tried changing the spelling of "true" to "True" in the metric formula to test for case-sensitive issue, without effect

I did not find any other clues in the documentation but I might as well have missed something.

IOT Sitewise measurements IOT Sitewise metrics

asked 3 months ago222 views
3 Answers
0

I did not see any suspicious on presented screenshots, and expect result to be computed whenever you continue suppling new data.

  • I suggest start from sending new data with current timestamp (i.e. to be sure data send after last model change and data point timestamp bugger then last model change timestamp)
  • Metric result should be computed at the end of window. So, if you working with 1 week window, you would expect result in the end of week. Such, I highly suggest 1 minute window for tests.
  • if you use measurement X outside of any aggregate functions, it will be converted to last(X). Result will be computed for data point with last timestamp in the metric window. This function require at least one data point present in the metric window to be evaluated.
Dmitry
answered 3 months ago
0

Thank you for your answer. I think that brings us to two separate issue in my case :

  1. I added multiple versions of the same metric for control purpose, varying the size of the time window to minute, hour, day and week and a last with no aggregation at all. Those metrics have been added today around 09:20 UTC+1 for info. Despite having a 'fresh' value in my measurements the same day I don't see any metrics outputing a value so far, including the metric with no aggregation. Would you consider this an expected behaviour ? Should I wait for a new value in measurements after the metric creation ?

Metrics for my device Measurements on this same device

  1. In my specific case, some measurements are updating only when their value change. The reason behind it is to rationalize cost of storage amongst other thing. The key info being : it can be updated once in a day, twice in an hour or maybe once in a month depending on what happens physically in the factory. In the scenario where the measurements is not updated in more than a week (which seems to be the maximum time window for sitewise metrics) : can my metric conserve the last value computed or will it fail to output a value because it has no data points in the defined metric window ?

Thank you for your assistance

answered 3 months ago
0

Please look the python script that create model similar to yours, send input data and receive results. (github) It working with real time 10 minutes window. You may observe, that metric start computing only from current time, even there are some data from available from last round 10 minutes, so suggest to start it when clock just turn over round 10 minutes to get most of results. It takes ~2-3 minutes for metrics to be computed, while transform result available almost immediately.

  • I am a bit confused with "having a 'fresh' value in my measurements the same day" statement. It is required to send new data with fresh timestamp after you update the model. Data timestamp should be later then model update timestamp. Otherwise no result would be computed, as old data accounted as related to old model.
  • Metrics always do some sort of aggregate. And most of aggregates compute result only if there are data point in the window. If you did not write any functions (like in your formula "is_on"), it will be processed as "last()" of variable (in your case "last(is_on)"). It will emit value with last timestamp from the window (or no result if no data in the window)
  • To question 2: there is set of functions, that work with data outside of current window. (doc) In your case, you could use ether 'latest()' or 'statetime()'. Both taking into account value before current window and computed for every window, even there are no data points (see in example script). 'statetime()` compute duration in seconds when variable stays in "true" state, which also could be useful in your case. See details in documentation.
Dmitry
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions