SiteWise ingestion rules coming from IoT Core

0

I have some devices that are three channel power monitors. I created a model that has separate measurements for rms0, rms1, and rms2. When I send them in, the format is JSON more or less like this:

{ measurement: "power_meter", timestamp: 1634185751589, fields: { rms0: 0.024, rms1: 0.025, rms2: 0.037 }, tags: { mac: "0102030405060708" }

I decided to push them in via IOT Core mostly because of the elasticity.

I am creating a rule to push these streams in, but I'm not clear on something. All three streams - rms0, rms1, rms2 - are part of a single Model. In the IoT rule configuration it says

Select a property ID from an asset model in AWS IoT SiteWise so my rule writes three different properties. All three have timestamp ${ts} and they each write a separate property with a value like ${fields.rms0}. I think (please correct me if I'm wrong) this means three separate API calls to IoT SiteWise meaning three times the cost (true?)

If all that is correct, then my question is this: within the action you can add "entries" (which I think really means "properties") and within each "entry" you can add "rows."

Why would I add multiple "rows" to the same property? Is this for a case where the incoming message has multiple samples with multiple timestamps in it, rather than one "row" at a time?

profile picture
wz2b
asked 2 years ago465 views
1 Answer
0

The IoT SiteWise rule action maps very directly to the BatchPutAssetPropertyValue API: https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchPutAssetPropertyValue.html . So it is a single API call even if you have multiple entries and/or multiple rows (property values) per entry in that rule action. Up to 10 entries.

https://docs.aws.amazon.com/iot/latest/developerguide/iotsitewise-rule-action.html

When you send data to AWS IoT SiteWise with this action, your data must meet the requirements of the BatchPutAssetPropertyValue operation. For more information, see BatchPutAssetPropertyValue in the AWS IoT SiteWise API Reference.

It doesn't have to be the case that each sample in the message has a unique timestamp. They may or may not. It all depends on how your sensor data is collected and sent. If you have multiple values all with one timestamp, that's fine too.

profile pictureAWS
EXPERT
Greg_B
answered 2 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