They are not so different though.
In scenario 1 the Item gets updated by the actual measurement at some point by the binding. That value gets saved to persistence and the predicted value gets removed.
In scenario 2, the Item gets updated by what ever updates the Item from persistence when the time comes for that entry to become the current state of the Item. Again, that “new” value gets saved to persistence and the predicted value gets removed.
It’s the same action. The only difference is where the update comes from. But whatever mechanism manages this shouldn’t care where the update comes from. It probably couldn’t even know if it wanted to.
But the fact that you have three entries sometimes makes me thing something else is going on.
I was going to suggest the same. I think core is not handling this correctly, but I’m still not 100% certain what’s causing the behavior.
Really, it’s for what ever mechanism updates the Item from the timeseries. It needs to either prevent that update from being saved, or, as I suggested, remove the predicted value prior to updating the Item. Then the update will replace the predicted value through the usual mechanisms according to the persistence strategy.
It occurs to me you can work around this right now by changing the persistence strategy to not save on everyChange. Then the database will only contain those predicted values because the updates won’t get saved as duplicate records.