Persistence functions in HABPanel

I’m wondering if there is a way in HABPanel to access historic item states from persisted items or the possibility to use the general persistence functions, like averageSince, maximumSince, etc.

What I want to achieve is to add indicators, like in @pmpkk’s Pride Theme, that show if a value is increasing or decreasing in relation to the previous value. AFAIK @pmpkk is using a python script to get the persisted values from the InfluxDB, but I would prefer a more native way if possible.
Any ideas?

No they are not available, the only way is to use them in rules and set the results in an item’s state, then display that item. In theory you could also code equivalents in JavaScript, working on the historical data retrieved from the persistence REST API (the one used for charts), but I would advise against it as it’s not efficient and probably not accurate.

Thanks for your clarification. Is there a chance that these are implemented natively in the future, or would this be inefficient in either case and therefore not reasonable? (Looking at the source code of the charts widget I feel like I could try myself but by now I have almost zero knowledge about JavaScript)

There are a few aggregation features implemented client-side in the new OH3 UI, they don’t include averageSince or similar, it’s quite complicated to get it right, so it doesn’t apply to your scenario (which I reckon is representing trends).

There’s a new “layout pages” concept in that UI, resembling HABPanel but not quite, as it’s optimized for your average mobile screen with varying widths, not fixed tablets; some widgets will however feature a trendline:


There could be an equivalent in HABPanel however, even if the technologies differ, someone could end up doing it.