Based on what I understand you are asking for I don’t know if it has ever been considered to be made a part of the code. It shouldn’t be too hard to add a
MyItem.persist(<db>, <timestamp>) to the Item class. This is in fact supported in the REST API.
But as rossko57 points out, the tricky part is getting that timestamp. That will require a separate Channel and a Rule to call that new persist method (or make the REST API call) to store the state with the reported timestamp.
It’s important to remember that Persistence needs to support all use cases which means that it ends up supporting the least common denominator. Your use case is a pretty rare one so I wouldn’t expect it to be supported directly. You will have to write Rules for this, or modify the binding.
And where does the Time of Event come from? For 99% of all the bindings, there is no such thing. There is only Arrival Time.
Persistence works on Item events. There is no way to pass this Time of Event to the Persistence engine because there is no concept of a Time of Event on the event bus.
The databases only currently support one time stamp. In some cases, like time series databases like InfluxDB, it isn’t even possible to have a row with three columns (two time stamps and a state).
So, to support this unusual use case in OH directly without needing you to write Rules would require:
- changes to all bindings
- changes to the event bus
- changes to everything that works off of the event bus
- changes to all of the databases people already have set up and configured for their persistence data
- no longer being able to support time series databases like InfluxDB, one of the most popular databases
This really seems to be massively disruptive to support a pretty rare use case.