Parameters for bucket storage

Hi,

I think It would be great to be able to set some parameters regarding the storage in buckets:

  • Storing a value only when it moves +/- a specified amount from the last one

  • Storing based on time. Minimum and maximum time between samples

I think that could be a great change particularly for data that are expected to be received once or doesn’t change that much over time.

Thanks,

Alexandre

Hi Alexandre,

Thank you for your suggestions regarding bucket storage parameters. Your ideas for conditional storage based on value changes and time intervals are valuable.

While we don’t have these exact features built-in, it can be achieved using similar functionality through our Payload Parser. Here’s how you can implement your suggestions:

1. Storing a value only when it moves +/- a specified amount from the last one:

You can use a combination of the Payload Parser and device Configuration Parameters to achieve this. Here’s how:

  1. Set up an Action to trigger an Analysis when data is received.
  2. Use the Analysis to store the last value in a Configuration Parameter of your device.
  3. In the Payload Parser, access the stored value using device.params and compare it with the new value.
  4. If the difference exceeds your specified threshold, allow the new value to be stored; otherwise, remove it from the payload.

2. Storing based on time (Minimum and maximum time between samples):

This can also be implemented using the Payload Parser:

  1. Store the timestamp of the last stored value in a Configuration Parameter.
  2. In the Payload Parser, compare the current timestamp with the stored one.
  3. If the time difference is within your specified range, allow the value to be stored; otherwise, remove it from the payload.

The Payload Parser supports JavaScript code, giving you the flexibility to implement these logic checks before data is stored in TagoIO. You can access and manipulate device Configuration Parameters through the UI interface, API, and Analysis, making it a powerful tool for custom data handling.

To get started, I recommend checking our Payload Parser guide: https://community.tago.io/t/in-depth-guide-to-payload-parser