For the life of me cannot see what is going on here, I have read numerous examples, and spent way too long messing with it, any pointers gratefully received.
Aim is simple(ish) fire off an alert if a device in a group has not sent in any update in the last X mins, some devices do not change, but send in repeat status, hence working with update.
The issue I am seeing is that despite the logs showing an update has not been received for over the specified length of time (5 mins atm) the logic is still marking the device as seen. (confirmed by log timestamp and output of item.lastupdate in the logs)
That may not be referring to the same database, it goes to the default persistence service. (That’s rrd4j in OH3, unless you’ve changed it.) I’d be specific so you know you’re looking at consistent data. item.lastUpdate("mapdb")
For a completely different approach, you can use the expire feature to allow each individual Item to set itself UNDEF when updates stop coming, which also takes care of avoiding using stale data. Alerting then just listens for any Groupmember changing to UNDEF. No kludgy cron rules, it’s event-driven.
Would be nice if that was the fix, sadly I have mabdp set as default, for completeness I have made the change all the same.
I am aware of the expire feature, I have a good number of sensors and was trying to avoid firing up a large number of expire timers, given the data should be in the db already.
As much as anything else, this should work and I hate to be defeated
Oh, I agree it ought to work in principle. I’m not very convinced lastUpdate() provides anything meaningful with mapdb, you certainly seem to be demonstrating that. Not all the persistence services provide all the functions, although we might expect a null return if is not supposed to work.
To eliminate timezone silliness, got any (or can make) an Item entry not updated for a full 24 hours?