I have several sting items in my OH configurations, which are linke to a channel of the http plugin. In items configuration menu as well as in the semantic Main UI the values are shown as expected.
In Basic UI this strings are not displayed. The Items simply added by
Default item=PluggitBypassActualState but also
Text item=PluggitBypassActualState has the same effect. I only see the label and the icon but not the items value.
I have the same problem with multiple string items linked with the http plugin. String items linked with channals from other plugins works.
What could be the problem and how to fix it?
I just updated to OH3.4 but I also hat the issue before.
You probably need to add the label. Check the examples in the documentation.
Text item=LR_Multimedia_Summary label="Multimedia [%s]" icon="video"
The important bit is the
Alternatively if you have created the item via UI add state description metadata
Normally there is a default pattern for string items, “℅s”. Maybe a label is required on item or sitemap element, even without a pattern?
Thanks for that hint, by adding
label="LabelName [%s]" the string value get’s displayed. But finnaly i need to redefine the items label.
It’s somehow inconsistant. For other string items it works without that label, for this not. So it seems that is a workaround to “hide” the root cause of the issue.
Some bindings also set a default %s pattern on their (string) channel types, sone others don’t. If your problem is only with the HTTP binding, that would be something to check in this binding.
If no default pattern is defined by the binding for the channel, maybe you need to define a label with a %s pattern.
To be honnest, I have in mind that many years ago, I added code to have always a default pattern for string items, maybe this code was then removed.
By curiosity, did you try to set a label without a state pattern? Is the value displayed in that case?
if i just define a label with
label="%s" its just %s displayed on left side.
label="[%s]" I only see the value ItemsString on right side, left side is empty.
label="LabelName [%s]" I see LabelName on left side and ItemsSring on right side.
In all cases the Items original label is ignored.
Simply add the state pattern to the item, if this is what you want.
@Lolodomo: Thanks for your help. For me it help when I can unserstand why things in OH happen. There a a lot of stuff what I need to understand.
If got you, for example this bindind defines a pattern:
What http dosn’t do:
If I manualy add that pattern to the items metadata, it’s now displayed as expected.