Finding last time an item was a certain value

Is there a reasonable way to discover what time a given item’s state as a specific value? I looked at the persistence docs and didn’t see a solution.

My specific use case is, I want a rule to turn off a light at midnight, but only if there was no motion detected in the room in the last 2 hours. So I need to find out what time a motion sensor’s state was changed to “1”.

You don’t even need persistence. It’s very common to use an associated separate timestamp Item for this purpose, for key Items.
There’s even a channel profile to make that easier.

Or you can use persistence with previousState(true), and examine the timestamp of the object returned.