AWS IOT - How to retrieve device status when the value remains unchanged

0

Hi there,

I currently use a device with an inbuilt MQTT function to send a 'packet' of data to AWS IOT every 10 seconds using a thing. Within the 'packet' are ~40 values (i'll refer to them as tags) of type INT, FLOAT, STRING and BOOL.

I then send the values of the tags in the packet to a timestream DB using the thing's shadow $aws/things/my_thing/shadow/update/accepted. The shadow looks like this:

{
  "state": {
    "reported": {
      "Humidity": [
        37.3
      ],
      "Temp1": [
        48.7
      ],
      "Temp2": [
        53.2
      ],...

This is working fine, however the value for a tag is only logged in the shadow if its value changes. i.e. if Temp1 stays at 48.7 for 10 seconds, in the next update it will be excluded from the shadow completely. Is it possible to send the full list of tags regardless of whether they have changed in value or not?

Thanks

JSap
已提问 10 个月前199 查看次数
1 回答
1
已接受的回答

Subscribe to $aws/things/my_thing/shadow/update/documents topic to get the full content of the shadow.

As you are using Amazon Timestream to store the values, you can achieve the same outcome without using thing shadows and thus reduce the overall solution cost. Amazon Timestream provides interpolation and binning functions that allows you to only send the data that changes and to reconstruct the other values as needed. For example using the interpolate_locf function you can obtain the last stored value of a given property. See https://docs.aws.amazon.com/timestream/latest/developerguide/timeseries-specific-constructs.functions.interpolation.html

If the latter option satisfies your requirements, you can further reduce the ingestion costs by using Basic Ingest

AWS
专家
已回答 10 个月前
profile pictureAWS
专家
Greg_B
已审核 10 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则