OpenHAB3 - Adding "Last Seen" Entry to Sitemap via GUI

  • Platform information:
    • Hardware: Raspberry 3
    • OS: openhabian
    • openHAB version: openHAB 3.2.0

Hello Community,
I’ve added my UniFi-Controller (Running on a Raspberry Pi3) sucessfully to OpenHAB. I’ve also added one of my WiFi-Clients properly - So i can see the current Online-Status (Works great) and also the “Last seen” information.

I’ve already added the Online status successfully to my Sitemap via the OH3 GUI.
Unfortunaly, i’ve got issues for adding the “DateTime - Point”, created by the “LastSeen” Channel of my WiFi-device, to my sidemap. All available options there aren’t working properly.

So, i’ve have a general question: Is it possible to add “DateTime” informations via the OH3 GUI or can i just add these kind of information, when i’m directly editing the sitemap file?

Kind regards,
Beliarsfire

I would add an item with no channel defined as DateTime-Point and a small rule which set’s the timestamp to the current date/time whenever the device online status changes

1 Like

This is something that could be pursued. There’s no reason that shouldn’t work unless it’s an event channel instead of a state channel. What’s the Channel type? What have you attempted when you say “all available options”?

This kind of denotes perhaps a confusion on how this all works.

It’s all Items. Everything shown on a sitemap comes from the state of Items. So if you want to add date time information to the sitemap (or anywhere else really) you will be adding the state of a DateTime Item. How does the DateTime Item get it’s state? In this case by linking that Item to the LastSeen Channel.

You don’t need a rule for this. You can use the timestamp profile.

1 Like

Ah sorry, I missed that the Timestamp is already delivered by a channel

Thanks for the quick response.

I’ve created an item, called Smartphone LastSeen which Type is DateTime. When i’m checking this item, the information (“Last seen” (2022-08-19T15:05:05.000+0200 ) was successfully added.

I’ve wanted to add them to the sitemap via the OH 3 Webinterface (Pages > Sitemap) in the next step.

Then i’ve wanted to link the created item with an new Widget via the Button (Insert Widget within the Frame).

All available options, which will be shown, didn’t show the “Last seen” entry (2022-08-19T15:05:05.000+0200) on the sitemap.

As example the Text-Widget only showed me the Text “Smartphone LastSeen” of the item. Not the content which is stored in the item. I’ve also tried all other widget - unfortunaly without success.

So my questions is, are there any widgets available which i could use, for showing the entry (2022-08-19T15:05:05.000+0200) properly on the sitemap?

You definitely want to use a Text element. You may need to set the State Description Item metadata. Or you should have a “label” field somewhere there to fill out (I don’t use sitemaps anymore and have never tried to create one through the UI). In that field you need to tell it to show the state of the Item. If you don’t need to format it in any way, just use something like Last seem [%s]. See Items | openHAB.

To format the date time string see Items | openHAB

1 Like