ECMA2021: getting "lastUpdate"-timestamp of an item without persistence

No, that information doesn’t exist anywhere outside of persistence.

@Wolfgang_S’s approach is the simplest.

The Threshold Alert rule template was made for this use case. I use this template to send me alerts when a door is left open for too long, a sensor Item doesn’t change for too long of a time (indicating something went wrong), a service/device status changes to OFF, the motion sensor at my dad’s house doesn’t detect motion for too long of a time, and more.

It’s a really common use case which is why I made the rule template.

Of all the things in OH, Items are the cheapest. Certainly you can avoid creating more Items but any solution that doesn’t is going to be way more complicated and effort in the long run.

Seconds between the rule making the call and the called rule running? That indicates a problem, not something you should really be trying to work around with rules or the like.

Another approach you could use is to create a SCRIPT transformation that sets a timestamp Item metadata on the Item when it’s updated from a Channel. Your rule that updates will need to do that itself. You’re saving some Items but not really saving any actual work and definitely not making your system more efficient compared to the timestamp profile and extra Items.

1 Like