OH3: deltaSince(365) --- how to find the max days in a series?

I assume, you don’t have another persistence besides standard rrd4j running?
Depending on what OH-version you started, your rrd4j might be different, but I think standard (also in OH3) is 10 years worth of data. rrd4j slowly “degrades” the granularity over time, so with the standard OH-configuration it should not degrade to more than a day.

If you’re keen on keeping “clear” data, you should use another persistence like SQL DB (MariaDB/MySQL, PostgreSQL), which ootb don’t alter stored information unless you do it yourself. My MariaDB for instance is around 2GB of data from >1200 items over at least 8 years, but I do delete data I deem not worthy like states of lights or similar:

Having said that, I just tried to do the same like you did in your script with the working hours of my solar pump, and my rrd4j and mysql allow for more than a year (I used 2 years here):

2024-11-14 07:57:45.026 [INFO ] [g.openhab.core.model.script.INFO1.01] - 730 days of rrd4j = 4146.0
2024-11-14 07:57:45.030 [INFO ] [g.openhab.core.model.script.INFO1.01] - 730 days of mariadb = 4146.0
1 Like