How to get lastUpdate time in Widget

I want to show the time an item was last updated in a widget.

I tried


All of them return nothing.

The item is persisted in influxdb. What am I doing wrong?

To make use of persisted states inside scripts and rules, a few useful extensions have been defined on items. Note that these extensions are only available to be applied to Items. They are not generally available for use in Scripts or Rules.

Found this sentence in the docs and I feel like it has to do with this, but I don’t really understand it. At first it says it is only for scripts and rules and at the end it says they are not availabale in scripts and rules.
What does “applied to items” mean? How can I use it in a widget?

All it means is that there is no general feature like
lastUpdate(someTable, some PersistenceService)
the persistence extensions only extend Item objects like

You cannot.
The features are available on the Item objects inside openHAB i.e. in rules and scripts, where the Java Item object is available to you.

The Java Item ibject is not available in your browser.

As a rule of thumb, if you want to display anything in your UI you will need to get it into an Item state.
In this case, you might create a new DateTime Item and have a rule update that from the other Item lastUpdate that you are interested in.


thank you. I ended up solving it with the timstamp-update profile


DateTime mailbox_mail_ts "Post Timestamp" <status> (driveway)  ["Status", "Presence"] {channel="mqtt:topic:BigmacBroker:mailbox:NewMail" [profile="system:timestamp-update"]}

Together with this widget:

uid: widget_now_to_then
tags: []
    - description: Title
      label: Title
      name: title
      required: true
      type: TEXT
    - context: item
      description: The DateTime item to show
      label: DateTime item
      name: item
      required: true
      type: TEXT
  parameterGroups: []
timestamp: Oct 30, 2022, 12:58:59 AM
component: f7-card
  content: =dayjs().to(dayjs(items[props.item].state))
  title: =props.title