REST : Deleted link still available?

Hi,

This is my first post, so please apologize if I’m not doing it the right way.

Context:
I’m testing OH2 with a few Zwave devices, trying to use Habmin,Paper UI and configuration files with a lot of try and fails. At a moment, I decided to restart from scratch and deleted the Zwave binding.

After adding the Zwave USB stick, one item linked to SOF, I saw a lot messages similar to this one in logs:

18:47:59.624 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update ‘73’ for item ‘ZwaveStatsSOF’ to handler for channel ‘zwave:serial_zstick:f4e4537b:serial_sof’, because no thing with the UID ‘zwave:serial_zstick:f4e4537b’ could be found.

These messages are justified, my USB stick has a different UID now.

Action
Using Rest API, I can see 5 links related to the old Zwave Controller (http://x.x.x.x/rest/links).
When I try to delete these links, result is ok … but they are stil present in the logs (and in the list of links).

If I restart OH2, all is fine.

Currently when an item is deleted, its links remain which can be confusing when you add a similarly named thing as you can get errors. This is a known issue…

However, if you delete them through the REST api, they should delete fine - they do here anyway as HABmin will delete them after deleting items to work around the above issue.

Thanks Chris,

I didn’t notice this smart home issue that explains why I had these links. (And I agree with you, channels deletion should be done when an item is deleted).

In my case, what I am trying to explain is, sorry for my broken English, even if the result of a call to the API to delete a link is OK, this link is still present until you restart OpenHab.

From my point of view, the need to restart Openhab for the deletion has to be taken into account migth be an issue.

You said that some of your config is done in text files? I assume that the links aren’t somehow done through them? I would agree that you shouldn’t need to restart openHAB, but from what I’ve seen the links are deleted, and a restart isn’t necessary. Maybe there’s something specific to your configuration that is preventing this (eg the text files - that’s just a guess though).

To be sure of my answers, I have restarted my tests from an empty config.

You’re right. I’m using text file for items definition and sitemaps definition.
When I change links to the items in the *.items file, the model is reloaded but previous links definitions are kept. And as any link defined in text file can’t be delete by API (I’m just wondering why - but I probably have some doc to read ).

Restarting Openhab allows to flush all these ghost links, what led me confusing.

Thanks a lot for your quick response, sorry to make you loosing your time.