AWS IoT Core and AWS IoT Sitewise data mapping

1

Hello AWS people. I generated data from cloud9 and sent it to AWS IoT Core MQTT Client. And I am working on matching each value to AWS IoT Sitewise asset with IoT Core Rule.

I created IoT Core Rule as shown in the picture. I made two actions. Each action sends data to each IoT Sitewise asset. I have two asset, 'ast-wowlic' and 'ast-medialab'. One action is for 'ast-wowlic' asset, the other action is for 'ast-medialab' asset.

`Property alias entries
1
propertyAlias: /Library/MediaLab/Temperature
propertyValues:
1
value:
doubleValue: ${temperature}
timestamp:
timeInSeconds: ${timeInSeconds}`
`Property alias entries
1
propertyAlias: /Library/WOWLIC/Temperature
propertyValues:
1
value:
doubleValue: ${temperature}
timestamp:
timeInSeconds: ${timeInSeconds}`

But I have an error. I tried to send each data to each sitewise asset alias. However, the same data was included in each asset. All I wanted was for the temperature data of wowlic to go into wowlic alias, and for the temperature data of medialab to go into medialab's alias. How do I get different data in each asset?

my data is like that... I have topics : dt/hansang/library/dvc-ctc-hansang-dev-wowlic/sta

{
  "device_id": "WOWLIC",
  "timeInSeconds": "1694499269",
  "temperature": 21.017
}

I have topics : dt/hansang/library/dvc-ctc-hansang-dev-medialab/sta,

{
  "device_id": "MediaLab",
  "timeInSeconds": "1694499325",
  "temperature": 25
}
2 Answers
0

From what you write in the question I understand that you wrote 2 actions for the same AWS IoT Rule, which means that the data extracted by the rule from the message will be pushed to both actions, explaining the observed behaviour.

In order to have the MediaLab data sent to the ast-medialab asset and the WOWLIC data sent to the ast-wowlic asset you need to create 2 rules. For Medialab, for example, the rule SQL should be similar to

select * from  "dt/hansang/library/dvc-ctc-hansang-dev-medialab/sta"

and have a single action sending the data to the ast-medialab asset.

You have something similar for the Wowlic topic

AWS
EXPERT
answered 8 months ago
  • Thank you for your answer. Is is right that you mean that I make ONE IoT Core Rule with ONE action to send data to Each IoT Sitewise ASSET? If I do this, when I made 1000 assets then should i made 1000 IoT Core rule?

0

Hi. Massi has identified your problem. As I've said in answering your other question (https://repost.aws/questions/QUv5liAyUhSHe6G-SKjLRzTQ/iot-sitewise-to-iot-core-rule), you can use substitution templates so that one rule (with one action) could potentially work for every topic/asset/stream.

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