Reading the Label of a set item

@oeo like you I’ve been struggling to find out how to pickup the value of the Label variable using a custom widget and never found a good answer via Google or community.openhab; after stumbling onto a random post about someone asking about having the category shown on their custom widget did I finally piece together the way things need to be formatted for the item label to display on the custom widget!

       <div>{{getItem(config.myVARname).label}}</div> 
       <div>{{getItem(config.myVARname) | json}}</div>    

myVARname of course being the name you supply in the setting of the custom widget; hopefully anyone else looking for this info can save some time with their life! The second line is just to display the entire contents of the item in question and is more for troubleshooting purposes.

Forum posting that solved it for me - Access item category in custom widget - #4 by ysc