Get items Penultimate Update

Hi,

first, I’m not sure if Google translate spit out the right word :slight_smile: Haven’t heard “Penultimate” before. I tried to translate the german word “vorletztes”.
So let me explain: I want to know when a device was last online befor it went just online again. Reason is the house shall greet friends saying:"Hi, nice to see you again, it’s been x days since you last where here"
I tried lastUpdate(currently it counts the seconds but I’ll just divide that once i get problem1 solved):

var Number dif_days = Seconds::secondsBetween(new DateTime(cFboxiPhoneOnline.lastUpdate.millis), now ).getSeconds()

But this gives me the seconds since the device went online the last time - which of course is always just a few seconds ago. What i would need would be the date the item went last online before that. which actually should be the third-last entry(“das vor-vorletzte” :wink: ),now that i think of it:
lastupdate: - device just went online (what i currently get)
the update before lastupdate - device went offline (nope, don’t want that)
the update before the update before lastupdate - device went online some while ago (and that is what i want)

Who would know a solution?
Many thanks in advance,
Best Regards,
-OLI