HTML In a label?

I’m using openhab2 and the basicui

Is there anyway to use HTML inside of a string and format it a little fancier?
EX: instead of having title album artist
Can I display it as
Title
album
artist

?

Hey @RonC, I don’t think that’s possible. You might try normal <b>html tagging</b> but I guess you already tried that without success. Limiting the sitemap layout was I think a design decision to make it easier for users to build intuitive GUIs and more importantly, to allow other UIs (iPhone and Android App, PanelUI, …) and the REST-API to be based on a well defined basis.

That said. What I heavily use are Unicode symbols, they can be used in labels, rules, transformations,… (the presentation of some of them here is not how they will look in BasicUI)

  • “Speedtest ᐁ 22.0 Mbit/s ᐃ 4.2 Mbit/s (69 ms)”
  • “PC off ✘” / “PC on :heavy_check_mark:” / “PC unknown :interrobang:
  • val status = if (KodiPlayerState.state == "Play") "⏯" else if (KodiPlayerState.state == "Pause") "⏸" else "⏹"
  • “ARIES=♈ Widder” / “TAURUS=♉ Stier” / “GEMINI=♊ Zwilling”
  • “NEW=🌑 Neumond” / “WAXING_CRESCENT=🌑→🌓 zunehmender Halbmond” / “FIRST_QUARTER=🌓 erstes Viertel”

And so on.


http://charmap.de (german)
https://en.wikibooks.org/wiki/Unicode/List_of_useful_symbols
http://unicode.scarfboy.com
http://emojipedia.org

In an example like this, are you using a MAP or visibility to use the unicode symbol corresponding with the Item’s state?

the PC, zodiac and moon examples are from my transformation files, Speedtest and Kodi are part of my rule logic.

devicestate.map:

ON=Ein ✔      
OFF=Aus ✘
NULL=unbekannt ⁉

Unicode symbols can used in all openHAB strings. The only limitation is, that your UI font needs to support the symbol. With BasicUI and the Android font that’s mostly the case.

Sadly, the moon symbols are not supported by BasicUI

1 Like

And another topic worth posting into Examples & Tutorials :sweat_smile:

1 Like