Refresh label from an item

Hello,

I change the label from an item with this rule:

‘rule “eg_bz_thermostat_soll”
when
Item eg_bz_thermostat_ist changed
then
eg_bz_thermostat_soll.label = eg_bz_thermostat_ist.state.toString() + " °C IST Temp->Soll [%.0f °C]"
end’

If I show the Basic UI in my browser, after start the rule the value from the item is changing immediately without refresh the page.
But the label string is not changing. The text from label is only changing, if I refresh the page.
Can I configrue OH2 so, that the label-field is also changing immediately or I trigger the label to changing it without refresh?
Thank you!

I have just done this. see my rule.

rule "update switch label"
when
    
        System started or 
        Item NL_SS_Switch_05_Label changed

then
    
    logInfo("Test","Setze Label auf: {}", transform("MAP", "nmb2label.map", NL_SS_Switch_05_Label.state.toString))
    NL_SS_Switch_05_State.label = transform("MAP", "nmb2label.map", NL_SS_Switch_05_Label.state.toString)

end

Fpr the refresh thing. i have never checked that, but i assume hat changing the label is no triggering reason for the UI

Yes, this is a nice idea but labels are not meant to be used this way, reason why the UI does not auto refresh

1 Like