Sitemap: Add additonal information to a Switch

Hi !

Currently i’m running on openhab V4.1.1 and as user interface I solely use the concept of sitemaps.

As there are so many things and functions implemented over the years, “house keeping” needs to be done regularly to keep the overview :slight_smile:

In my “main” page I use Text fields and connect them with String-items to give them additional UTF symbols to somehow “pack” the information.
Example:


Those UTF-symbols on the right side will change, if some status changes. E.g. for washing machine the icon will change to :white_check_mark:, when the washing process is finished :slight_smile:
This done by a rule, which updates the String-item behind it.

Now my question:
I wonder if there is also a possibility to somehow add more information to a Switch in a Sitemap. As I have some WiFi plugs with power meter function. It would be so nice to have a switch with the dynamic (!) information of the metered power (e.g. “3W” in that example). Something like that:

Do you have some best practices here?

Thank you!

Unless this has changed, the label of an element in a sitemap can only reference the information in the one Item in the element. You cannot combine the states from multiple Items in one Item’s element.

If it were a String Item you could combine information from lots of different Items as the state of the Item, but then the Switch toggle won’t work.

The only thing I can think of to make something like this work would be to use a Switch with mappings on the sitemap and make sure to set autoupdate to false on the Item. Then you’d have two buttons to press (or if you are clever just one). Then create a Rule that triggers on received command which forwards that command (perhaps without some processing) to the “real” Item.

This is trivial to do in MainUI but in sitemaps :man_shrugging: . The core concept of sitemaps is one-to-one relationship between Items and sitemap elements.

I also missed this multi-info already and found no solution for it.
This would be a nice enhancement!