How do I know when a new Metric value is available for a SiteWise Asset?

0

I have a SiteWise Asset with 12 Measurements and 36 Metrics. The Metrics are things like min, max, and average for each Measurement. So a Measurement might be Temperature and the corresponding Metrics would be Temperature_min, Temperature_max, and Temperature_avg.

I have notifications enabled for all Measurements and Metrics. I am simulating IoT data being sent to SiteWise by passing a set of property updates for the Measurements via the CLI's batch-put-asset-property-value command. This works well; I can see the data appearing in SiteWise for both Measurements and Metrics. Again, I'm sending data in for the Measurements only whereas the Metrics are calculated by SiteWise from these Measurement values.

I want to store all of this data by timestamp somewhere so I setup a IoT Rule that passes PropertyValueUpdate messages to a Lambda that updates a DynamoDB Item per timestamp. This partly works; I see messages going through the IoT Rule and appearing in DynamoDB for the Measurements but not the Metrics. It appears that updating a given property (Measurements or Metrics) triggers a notification but a Metric being calculated by SiteWise does not.

Is there a way to trigger a message when a given Metric is calculated in SiteWise or can I be assured that a Metric value is available when the Measurement's PropertyValueUpdate message fires, or is there a better way of doing what I'm attempting?

Thanks.

apenn
asked 4 years ago374 views
3 Answers
0

Hi! Thanks for the information. I'm sorry you are experiencing an issue with the notification on a property of type metric.

We do support sending a notification when a metric property is updated (even if it is updated internally by SiteWise). I did a quick sanity check and was able to receive a notification for a computed metric property.

Can you confirm the following:

  1. You are seeing the metric property update in real-time (computed internally by SiteWise) via a GetAssetPropertyValue but are not receiving a notification for it?
  2. You are subscribed to the correct topic as returned from a call to DescribeAsset?
  3. The property notification is indeed enabled

You can't assume a metric value is available when the measurement's BatchPutAssetPropertyValue is sent - as it could take some time until the metric is computed.

Additionally:

Have you had a chance to check out our blog post? https://aws.amazon.com/blogs/iot/collecting-organizing-monitoring-and-analyzing-industrial-data-at-scale-using-aws-iot-sitewise-part-1/

We are curious to know about your use case with DynamoDB as well. Have you considered accessing the information directly from the API via a GetAssetPropertyValueHistory request?

Thanks for your time

Edited by: awsseanb on Feb 26, 2020 2:49 PM

AWS
answered 4 years ago
0

Thanks for your response.

I'm happy to hear that a notification should be sent for Metrics that are updated internally by SiteWise. Likely I have something mis-configured somewhere. I will confirm the three points you've listed sometime today and report back.

As for my DynamoDB use case - I am experimenting at this point but we have an existing app that allows the user to see and step through an amount of IoT data for specific machines (For example, a selected 24-hour duration with data every 15 minutes for 40+ sensors). The user can step, or click along a timeline, to see how a machine is performing at any given time. I was interested in getting the SiteWise data in a similar form so this app could consume it.

I have accessed data via the GetAssetPropertyValueHistory request before but since that call only returns 1 property's data and I'm looking at showing 40+ properties (at a minimum) per timestamp in the app described above, that seemed like a lot of calls, manual aggregation, etc. Just thought that, assuming it wasn't too difficult, it might be more streamlined for now to get the data in a form that app was already consuming. I am fine learning that I am incorrect.

I have skimmed that blog post before but will take another look. Thanks!

apenn
answered 4 years ago
0

Hello again.

I was able to spend a little time looking at this and found that the issue was that I had the Metric notifications set to fire once an hour instead of once every 5 minutes or so. Changing that caused things to perform as expected. Thanks for your assistance.

apenn
answered 4 years 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