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
asked 9 months ago189 views
1 Answer
1
Accepted Answer

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
EXPERT
answered 9 months ago
profile pictureAWS
EXPERT
Greg_B
reviewed 9 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