Changes to config files not reflected in running config

From time to time I’m struggling with changes to the config files not being reflected in the running config. Lately I’ve tried to change the label on one of my Item’s but in the GUI it still has the old label no matter what I do. In the item file the item is configured as follow.

Number:Temperature      Nilan_T02           "Nilan - Temperature - T02 Inlet [%.1]"                         { channel="modbus:data:nilan30-dr302:inputRegisters:T02:number" }

In the item list in the GUI the label is

"Nilan - Temperature - T02 Inlet (before condenser)"

This was the label I gave the item when I created it, and later tried to change, unsuccessfully.

I’ve tried to add spaces to the label and save without it changing anything. I’ve previously had similar issues with things configuration, where it looked like the running config was one change behind the changes I made to the things file.
Does anyone have any idea on how to fix this annoying issue?

The configuration is invalid. Either use no state formatting at all:

Number:Temperature Nilan_T02 "Nilan - Temperature - T02 Inlet" { channel="modbus:data:nilan30-dr302:inputRegisters:T02:number" }

or use a valid format:

Number:Temperature Nilan_T02 "Nilan - Temperature - T02 Inlet [%.1f %unit%]" { channel="modbus:data:nilan30-dr302:inputRegisters:T02:number" }

I doubt that is the issue. I managed to get the label updated by deleting the item, save the item file, add the item again by pasting it back into the config file and save it again.

Also it doesn’t explain why I have had similar issues with things configuration from time to time. Last it was an IP address that was one change behind, as when I changed it from eg. 192.168.1.101 to 192.168.1.102 it would still be 192.168.1.101 in the running config, but when I changed it back to 192.168.1.101 it would change to 192.168.1.102 in running config.

Changes to .things files not being immediately loaded until a restart is a known problem fixed in OH 4.

As for the Items, if you are talking about MainUI, the proper way to set the label is through the state description metadata.

The first time the Item is loaded from a file, if it does not have a state description metadata, the Item label is used to create state description metadata. However, metadata exists independently from the Item. Therefore when you delete the Item and recreate it with the same name (which is what happens when you change a .items file), the state description metadata already exists and since the Item doesn’t have anything overriding it the old state description remains unchanged.

In short, if you want to use sitemaps, the label on the Item in the .items file is one way to control how it appears. But for MainUI, you must use the state description metadata to control how the Item looks.

The only reason why the Item label gets converted to state description at all is to help users of older versions of OH transition to MainUI. If you don’t plan on using MainUI, you can continue to use the label field on the Item. If you do plan on using MainUI, you need to use the MainUI way of controlling the label which is the state description metadata.