Given my experience of the last few years, the most annoying issue I have encountered is my ZWave devices running their batteries down without ever reporting the battery below 100%. Obviously you can’t make the device report such things, but could we add a LastUpdated Channel to all Z-WaveThings so we could create and item and set up Cards that display the last update so we can check that and go, hrm that hasn’t updated in 6 hours, I bet the battery went belly up… or is such already doable and I’m just ignorant and searching wrong for the solution? (Apparently this channel is a thing under the MQTT binding)
Any channel can be linked to a DateTime Item using the timestamp-update profile.
The profile modifies a channel’s state update, in this case radically modifies to a timestamp of ‘now’.
Channels may be linked with more than one Item, so it can be used for its normal business as well (without the profile on that link).
For what you’re describing, pick a channel that gets regular updates. It’s then up to you to write rules to detect a problem.
An alternative approach is the use of the ‘expire’ feature on an Item. This is effectively a timer that restarts at every Item update.
For example, you might have a temperature sensor reporting each 5 mins.
With an ‘expire=12 mins, state UNDEF’ if two updates are missed then the Item is updated to UNDEF as the reading is false, and a rule can detect the state change to ring a bell.
I use the first method outlined by @rossko57 (timestamp on the battery channel) and then use a label card in the UI with the footer showing the time. Excerpt below:
Ok, I created the Items @rossko57 suggested and that works sort of… I even got it to dispplay he item..state but I am definitely missing a step here somewhere… my displayed value is ugly 2022-01-28T19:58:10.213456+0000 and I am apparently being too thick to see where/how to do the transform to get a “YYYY-MM-dd HH:mm:ss z” and hopefully even transform to EST instead of UTC? Is it in the Label Field or the Item setup itself?
I will mark this as the solution as soon as I figure out the transform piece and apply it and document it in a reply… It answered the initial question closely enough to get me where I needed to look in the docs…
There are different ways to format any Item for display, but it depends on just how you created it, which is a secret from us.
In OH3 in general, you would use the Item metadata ‘pattern’ field, which will take standard Java string formatting terms.
DateTime Items are normally displayed in the local timezone set in your system default.
Go to Item
%1$tb-%1$td %1$tl:%1$tM %Tp
If you are doing a footer in the label card
Looks like Rossko beat me to it
Thank you both, it now works as I need it to… I did have to kick my
Rasbperry Pi to fix the TZ issues…not sure when it lots its default TZ…
The main issue I was having with the format (once I figured out how to display it) was that the alphabetic names came up upper-case in the sitemap, but when looking at the item, it showed “normally” (first letter UC and the rest LC). I was hoping there was a variable to fix this, but alas, not so lucky. It’s fine as it is, I’m just picky.
be aware there is an issue with some zwave channels having a format ‘forced’ on the channel and formatting a DateTime item hooked to the channel with timestamp profile will not allow formatting of DateTime.
Sorry if this was already mentioned
If not read more here