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개 답변
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
전문가
답변함 8달 전
  • 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
전문가
Greg_B
답변함 8달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인