Habbapp - migrating from jython questions

Since jython is a dying thing I’m planning on migrating my rules to HABapp. It does include a good amount of time and effort therefore I want migrate as many rules as possible without changing them or approach (the already made) solutions differently.
At first glance there are some challenges with actions, but I can work around them I think without much effort.
I do however use persistence many times with functions like “averageSince” and “updatedSince”, are there any replacements for these? AFAIK, these are not mentioned in the docs. :thinking:

HABApp is different and not a drop in replacement.
So if you want to keep your rules the same things will get quirky and probably hard.
Why don’t you keep the working rules running and start slowly experimenting with HABApp.
It won’t get in your way and you can use a mixture of both without problems.

E.g. in HABApp all items have the timestamp of the last change and last update.
So it’s just

if datetime.now() - self.my_item.last_change > timedelta(minutes=3):
   # item changed 

No need for persistence.

You can do item.get_persistence_data().average() but this will load all data from openHAB so it’s not quite the same. Depending on the average interval this might work well.
An alternative could be the AggregationItem from HABApp (again depending on the interval and data changes).

Ok, thanks. Yeah you might be right, I will have to run things mixed for a while.
But I think I’ll create a “wrapper” lib for my persistence data simulating the same functions, I think it will save me some time :crazy_face: (or be a waste of time …time will show!)