Java Runtime Environment: openjdk version “17.0.8” 2023-07-18 LTS
OpenJDK Runtime Environment Zulu17.44+15-CA (build 17.0.8+7-LTS)
OpenJDK 64-Bit Server VM Zulu17.44+15-CA (build 17.0.8+7-LTS, mixed mode, sharing)
openHAB version: 4.0.1
Issue of the topic: Inbox-Things automatically detected are not removed from inbox, after the real thing is created
I am testing OH4 with a new installation, therefore manually adding my things again via GUI.
Creating things from the inbox is working fine, but after adding the thing, the related inbox item is not removed.
Is this by design? My expectation would be, that the inbox item is removed, once the real thing is created.
I have seen this issue with different bindings (e.g. shelly, sons, hue) therefore I assume its something generic.
If logs where generated please post these here using code fences:
No errors / messages in the log (only that the new thing changes status e.g. form UNINITIALIZED to INITIALIZING…)
It depends on the binding used and how the representation property is set. The Shelly Bindng e.g. needs the ThingUID set to the device MAC address, otherwise it will reappear shortly after creating a thing with custom ThingUID.
This can be tested on Shelly devices by just changing one letter from lowercase to uppercase.
Thanks for this.
I did a test with a shelly thing:
If I add the inbox-thing without changing thing ID or thing Name, the auto-discovered thing is removed from inbox, after the actual thing is created.
If I change thing ID / thing name to anything custom, than the inbox-thing will not get removed from the inbox. If I manually remove the inbox record, it will rediscovered as you mentioned.
However for 2nd case, the real thing has the correct MAC address in the thing properties, therefore wondering why this is not enough and thing id / name has to include the MAC address
It is not uncommon to give Things a more meaningfull UID instead of the „predefined“. It will be readable in the channel links.
The issue exists within MainUI but surely will be in Things files as well.
We are talking about discovered things to be added from inbox.
Nothing special in the installation, as I just downloaded fresh OH4 files and did a clean / new setup for testing only. Everything UI based and no things files.
The thing uid is user configurable, therefore a binding should not dependent on the naming. (Don’t have a reference to this convention at hand).
I do see a mismatch in the binding code. The xml files use serviceName as representation property, while discovery creates things with deviceName as representation property. I don’t know if that is the issue here, but it should match.
My use case here is that I do not like the THING to be linked to the MAC address etc because if/when the device has to be swapped out for hardware issues etc then this “link” is broken and you either have to recreate every link etc or live with the now misnamed THING?