Persistence question API download vs. internal use

  • Platform information:
    • Hardware: X64
    • OS: Windows 11
    • Java Runtime Environment: 21
    • openHAB version: 5.2

I have a question on how the persistence service works.

I have defined RRD4J as the default service and I have the strategy set to every change, every update, every minute.

My items are updated via MQTT every 10 seconds and I can use the persistence service in rules to check for frequency of saved states and it is right on, 6 data points per minute.

When I use the API to download the persisted data I only get one datum point every minute no matter how far back the starting time is, I only look back 1 day.

Is this how it is supposed to work?, why aren’t the 10 second saves downloaded?

Thank you

Carlos

rrd4j decimates the data as the data ages. This is how it manages to keep it’s size the same no matter how old the data gets. How this is done and at what age the data gets decimated is all in the rrd4j docs. But ultimately, if you want the data to remain pristine and unaltered, you need to use a DB other than rrd4j.

The reason why you are getting a result only every minute is because, for number values:

It defines 5 archives:

  1. granularity of 10s for the last hour
  2. granularity of 1m for the last week
  3. granularity of 15m for the last year
  4. granularity of 1h for the last 5 years
  5. granularity of 1d for the last 10 years

Thank you

I’ll live with 1 minute granularity, it will not be reasonable to download data every hour just to get the 10 second granularity.