Connection lost with device for a little while for whatever reason
Device rejoins network, not aware of previous discovery, attempts to get discovered again. Or this is a newly reflashed device coming back with some parameters changed.
Remove previous version of device and any associated settings (ascii name, etc).
Present device for acceptance in PaperUI as a new device.
You can however update a Thing to change it’s parameters/name etc so that you don’t have to delete the discovered Thing.
As far as I’m aware (but hopefully @Kai can clarify) if you called thingDiscovered() with a new Thing that has the same ThingID as the old thing it will overwrite it.
In my experience, the first time the thing is discovered these values (label, etc) are set. After that, the Thing is cached in some storage (in case of Discovery anyhow) and is loaded from there on start, even if the physical device is not present. As such, discovery does not happen again, only the status is switched online/offline. Without going through the discvoery routine, new values aren’t available.
To summarize - yes, one can update “label”, but one does not know what the new value should be.
I’m not saying not to go through the discovery routine again, but assuming the Thing created on first discovery has the same Thing ID as the Thing created on second discovery (with updated configuration) then you shouldn’t need to manually delete them.
My binding does something similar. It sends out discovery packets which are responded too, but due to the communication protocol being UDP I receive multiple copies of the response (as a way to guard against lost packets). I create DiscoveryResults for each response but yet I don’t end up with multiple identical Things.
Just finished some experiments. Seems it is the PaperUI that is the culprit. The label changes if observed through /rest/things, but not through the interface.
Although, I am not sure if it is fair to blame it. I see several json members named “label”. Perhaps, I just need to find the right one.
is what I have been using to process a change in label but last night I updated my working copy of the OH2 and noticed getLinkedItem() is deprecated so that seems like it’s not the way to do it.