OpenHAB uses CoC (Convention over Configuration) for reading and writing persistence data to database (e.g. InfluxDB). If an item is named My_Item it gets saved to database table / time series My_Item.
How do I need to configure my item, so that persistence service uses another name for reading and writing to database, e.g. My_OtherItem?
So if I use the persistence data of the Contact (which gets persisted as 0 and 1) I could take that data, interpret it e.g. as Number and then do a sumSince().
The difficulty with the store-open/closed-as-number thingy is the OH persistence layer. When using the OH tools, it knows what kind of Item is involved and “translates” back, that’s its job.
Alternative access methods should not have that “help”.