voda
(D.)
1
- Platform information:
- Hardware: Proxmox Virtual Environment 8.2.2 on Futro S920
- OS: Debian 12
- Java Runtime Environment: 17
- openHAB version: 4.3.2
- Issue of the topic:
Helloy Guys. Why doensn’t work this sidemap code for mobile app:
Text item=Status_Licht label="Status Beleuchtung" valuecolor=[=="Büroschalter AUS"="red", =="Licht AUS"="green", ="Licht AN"="yellow"]
I would like to expect the following behaviour:
Status_Licht == “Licht AUS” shows green text
Status_Licht == “Licht AN” shows yellow text
Status_Licht == “Licht AUS” shows green text
Thank you very much
Lolodomo
(Lolodomo)
2
Check in logs what is the exact state value of your item.
How is defined your item ?
voda
(D.)
3
A screenshot
In this case, the item Status_Licht=“Licht AN”. I expect a yellow text, but it is in black
The item is defined as follows:
Lolodomo
(Lolodomo)
4
Is your problem in Basic UI or Android app or iOS app ?
Lolodomo
(Lolodomo)
5
A = seems to be missing at the beginning of your last condition (yellow).
1 Like
Lolodomo
(Lolodomo)
6
In case your problem is solved, please mark it as resolved and post a small message.
voda
(D.)
7
I have to check it. I mean the Basic UI. Nevertheless I don’t unterstand what you mean.
Lolodomo
(Lolodomo)
8
Th fixed syntax
Text item=Status_Licht label=“Status Beleuchtung” valuecolor=[==“Büroschalter AUS”=“red”, ==“Licht AUS”=“green”, ==“Licht AN”=“yellow”]
Instead of
Text item=Status_Licht label=“Status Beleuchtung” valuecolor=[==“Büroschalter AUS”=“red”, ==“Licht AUS”=“green”, =“Licht AN”=“yellow”]
voda
(D.)
9
Okay thank you
I’ll check it later and marked this thread as solved.
voda
(D.)
10
It doesn’t work. The code is not even saved. If I save it and refresh, the line is removed…
Neither work the code directly nor in the GUI:
In the meantime, I notice in the code editor a general issue but I can’t find the mistake.
Here the message:
But it seems be good. That is the code line 2 until line 9.
Selection icon=presence item=FritzBoxStatus label="Betriebszustand"
Group icon=sun item=Astronomische_Berechnungen label="aktuelle Sonnendaten" {
Text icon=iconify:material-symbols:height item=Sonnenhoehe label="Höhe"
Text icon=sun item=Sonnenrichtung label="Azimut"
Selection icon=sun_clouds item=Tag label="Es ist gerade "
Selection icon=sunrise item=Sunrise label="Sonnenaufgang"
Selection icon=sunset item=Sunset label="Sonnenuntergang"
Chart icon=line item=Sonnenhoehe label="Sonnenstand" period=12h refresh="1000000"
}
In the previous version of OH (like 3.4.2) the code was without failures.
I hope the one has nothing to do with the other
Mherwege
(Mark Herwege)
11
It looks like there is a bug in the UI parser when the icon contains a combination of : and -.
I will have a look when I have time.
Mherwege
(Mark Herwege)
12
Make sure to use the proper quotes. If you copy/paste, the quotes will be wrong. This line does work for me when I put it in the sitemap code window.
Mherwege
(Mark Herwege)
13
2 Likes
voda
(D.)
14
As I mention, I can’t save the code. I save it witch Ctrl+S, refresh the browser and the saved code is gone.
sihui
(SiHui)
15
Look at the quotation marks:
“ vs "
You will need the latter:
Text item=Status_Licht label="Status Beleuchtung" valuecolor=[=="Büroschalter AUS"="red", =="Licht AUS"="green", =="Licht AN"="yellow"]
This happens because of the forum software when text configs are quoted without the proper code tag:

Edit: removed one wrong quotation mark
voda
(D.)
16
I know, but sorry, it doesn’t work. I can’t save it with Ctrl-S if I change the code.
I added the following line:
Save it with Ctrl-S
and now
nothing happend!
sihui
(SiHui)
17
Which editor are you using?
Are you able to save other files?
sihui
(SiHui)
18
You copied a typo which I corrected in my edit, see above.
Mherwege
(Mark Herwege)
19
You have double quotes (“”) before yellow in your screenshot.
voda
(D.)
20
The Openhab one.
Maybe it’s connected with the bug: Pull Request #3048
I fixed yout code with one quote, but I can’t save anyway.
So, I’ve tried an another way. I add this in the Design GUI the following:
If I save, follow error message is showing:
I check the code:
and that is the proposed code line but … It doesn’t work 