Generic way to test "time since state became X" for device attributes?

You may also wish to consider the following: