mvo
(Marcel Oliveira)
July 5, 2018, 3:22am
1
Dear Community,
I have been using a sitema to parse map transformation command based on switch, but it’s printing besided my buttons the name of command, is it possible to hide this how to do?
My sitemap example below as well a screenshot from sitemap and in red the “label” that I wanna to hide…
sitemap quarto label=“Quarto Vargas” {
Frame label=“TV” {
Switch item=TV_QUARTO icon=soundvolume label=“TV Volume [%s]” mappings=[TV_SAMSUNG_VOL_UP="+", TV_SAMSUNG_VOL_DOWN="-"]
}
}
mvo
(Marcel Oliveira)
July 5, 2018, 11:26am
3
Thanks josar, let me test and than let you know the result!
Thanks again!
mvo
(Marcel Oliveira)
July 5, 2018, 10:20pm
4
Josar,
I did as you suggested, but it does not solve my problem…It’s a “variable” that I send to item use …
sitemap quarto label=“Quarto Vargas” {
Frame label=“TV” {
Switch item=TV_QUARTO icon=soundvolume label=“TV Volume” mappings=[TV_SAMSUNG_VOL_UP="+", TV_SAMSUNG_VOL_DOWN="-"]
Switch item=TV_QUARTO label=“POWER” mappings=[TV_SAMSUNG_POWER_UP=“ON”, TV_SAMSUNG_POWER_DOWN=“OFF”]
}
}
If you see it’s printing on the screen the mappings option.
hr3
(Harry)
July 6, 2018, 6:33am
5
Change the item-definition too. Romove the label or use a label without […].
Josar
(Josar)
July 6, 2018, 10:03am
7
String TV_QUARTO
Frame label="TV" {
Switch item=TV_QUARTO icon=soundvolume label="TV Volume [%s]" mappings=[TV_SAMSUNG_VOL_UP="+", TV_SAMSUNG_VOL_DOWN="-"]
Switch item=TV_QUARTO icon=soundvolume label="TV Volume" mappings=[TV_SAMSUNG_VOL_UP="+", TV_SAMSUNG_VOL_DOWN="-"]
}
Works as promised.
But if you keep the label definition at the item it wont, this is diffferent because the state representation in square brackets is not the label.
String TV_QUARTO "TV Volume [%s]"
Setting the state representation as empty in the sitemap will also override the state representation.
Switch item=TV_QUARTO icon=soundvolume label="TV Volume []" mappings=[TV_SAMSUNG_VOL_UP="+", TV_SAMSUNG_VOL_DOWN="-"]
opened 10:14AM - 06 Jul 18 UTC
closed 10:20AM - 06 Jul 18 UTC
wontfix
The documentation states that sitemap labels override the item definitions but t… his is not working as expexted.
see
https://community.openhab.org/t/basic-ui-sitemap-printing-command-besided-buttos/47378/7?u=josar
```
String TV_QUARTO
```
```
Frame label="TV" {
Switch item=TV_QUARTO label="TV Volume [%s]" mappings=[TV_SAMSUNG_VOL_UP="+", TV_SAMSUNG_VOL_DOWN="-"]
Switch item=TV_QUARTO label="TV Volume" mappings=[TV_SAMSUNG_VOL_UP="+", TV_SAMSUNG_VOL_DOWN="-"]
}
```
Works as promised.
But if you keep the label definition at the item it wont, this is diffferent then stated in the docs.
Now both labels show the state and the sitemap definition does not override the label definition from the item.
```
String TV_QUARTO "TV Volume [%s]"
```
https://docs.openhab.org/configuration/sitemaps.html#element-types
Consider reading about code fences.
We all have to type this content over and over and over. Here is a posting we can all point to when the topic comes up.
Why use code fences?
Because rules, sitemap, logs, and configs are all but unreadable when code fences are not used.
When to use code fences?
Whenever one is posting any sort of code, config, log, and any text where line wrapping, indentation, and using an equal spaced font makes the text more legible.
How to use code fences?
Use 3 backticks (```)...
Or use <code>...
…
mvo
(Marcel Oliveira)
July 9, 2018, 3:52pm
8
Hey Guy! I just worked after taking out item Label, Thanks so much !