Label not populated to a thing when doing discovery

Hi guys,
There is an issue reported with the discovery of things within the add on I have created a few years back.
In the log it seems that I retrieve the label properly from the system and in the discovery coding of my binding I use the withLabel() method adding a label to the discovery result but it does not get populated into the thing.

 DiscoveryResult result = DiscoveryResultBuilder.create(thingUID).withBridge(bridgeUid)
                    .withLabel("Partition " + label).withProperty(PARTITION_THING_TYPE_ID, thingId)
                    .withProperty("id", partition.getId()).build();
            logger.debug("Partition DiscoveryResult={}", result);

Is this an expected behaviour and do I have to create a separate property called “label” and populate it as a channel or there is a bug in the core discovery itself?

More about the issue itself with screenshots in this post: Paradox EVO Binding - #587 by Mark_VG

I’m not sure if I understand what you’re trying to do. The post you refer to mentions a channel called partitionLabel which is a channel and the label you are referring to here is the label (or how the thing is named) of the thing that is discovered. These are two completely different concepts. During discovery only the things are created and no channels are updated. Channels are updated in the thing handler. If you only have this ‘label’ available in disvovery and not receive it via data in the thing handler you can pass it as a property on the thing. (However that would also mean if the user would manually create a thing this value is never present, unless you make it a user configurable property). If this is data that is available from the device in the thing handler than you can use a channel and update the channel in thing handler when updating the channel states.

1 Like