Mqtt string value, displays correctly in widget, but cannot use it in a logical evaluation

On my log, i can see the string changing. On my Label list item also. But if i want to use it to control the iconColor for exemple, it’s not working. When checked with the code tool, it would seem that the string is always ‘-’. I’m kind of lost here.
The test code that shows the state of the item:
=items[sun_tracker_head_to_sun_err].state
The yaml portion where i m trying to control the icon color:
- component: oh-label-item
config:
item: equip_mqtt_syst_alarm_state
icon: f7:shield
iconColor: =(items[equip_mqtt_syst_alarm_state].state == “off”) ? “green”
:“orange”
iconUseState: true

Also, here is the log and part of the overview page vs this item

Any suggestions would be appriciated. thanks

found my mistake.
I changed from phrase from items[item_name].state to items.item_name.state
So the dot naming is working.
Maybe this will help other newbie like me… i love OpenHab so far :slight_smile:

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.