State change timestamps

Hi,

I’ve just setup my first MQTT binding where I have an item that receives an MQTT message on each change of temperature from a device. This is working fine. I also want to display the last time an update was received. Do I need another item for this or is this available as metadata on the existing item?

Thanks

I a not the brightest when it comes to OH…
However, I use rules for last update like so:

// ----- 170309 MaxG; save last date of Internet going down
rule "Update last update datum for WAN IP address"
  when
    Item nw_Internet changed from ON to OFF
  then
    INET_IP_LastUpdated.postUpdate(new DateTimeType())
end

Thanks, so is INET_IP_LastUpdated an item?

Yes, specifically for showing the date on the sitemap…

String   INET_IP_LastUpdated	"Internet offline since [%1$td/%1$tm %1$tH:%1$tM]"	<calendar>

Which in my case is only shown when the Internet is down:

    Text   item=INET_IP_LastUpdated		labelcolor=["red"]        valuecolor=["red"]        visibility=[nw_Internet=="OFF"]

2 Likes