Is there an easy way to get the previous value of a attribute whenever an event is triggered?
Event object passed to the handler has properties for the current value, so I was curious if there’s anything similar for getting the previous value. In the past, I’ve stored the previous value in
state and compared that to the current value, but I wasn’t sure if there was a better way to do it.
I’ve seen the
events method on the
Device object, but I wasn’t sure if this was a good use case for it. The SmartThings documentation suggests that it only keeps 7 days of data, but I wasn’t sure if that applies to Hubitat too.