eclipse-archived / smarthome

Eclipse SmartHomeâ„¢ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
862 stars 786 forks source link

[PaperUI][Homematic] Device description in Inbox only appears after a refresh #5722

Open MHerbst opened 6 years ago

MHerbst commented 6 years ago

I have installed the Homematic binding in a fresh openHAB 2.3 environment. After the inbox was filled with the detected device for all devices the description was "Unknown device" image

After refresh of the browser window (F5) some descriptions appeared: image

After 2 or 3 refreshes all descriptions were visible in Chrome. In Edge it took even more refreshes. Same happened again after a openHAB restart.

Test Environment:

I could not reproduce this behaviour with other add-ons.

sjsf commented 6 years ago

It looks like this behavior is specific to the Homematic binding, so let's focus on that one first.

From looking at the code, I can see that the thing types are created dynamically, so it would be plausible that this could be a race condition between the provisioning of the thing types and the publishing of the discovery results.

Also, I notice that the discovery results don't explicitly set a thing type - which should be fixed but is not likely to be the root-cause because it falls-back to the deprecated type inference through the middle part of the thing UID:

https://github.com/openhab/openhab2-addons/blob/6c9186a7a0db60c4cbb8f35cd85ad95a9b1e7a9e/addons/binding/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/HomematicDeviceDiscoveryService.java#L220-L223

The sources of the Homematic binding previously were kept in the openhab/openhab2-addons project. However, as it is currently in the process of getting moved over here via #5695, it is okay to have the issue here already. Let's consider it the first official one in the ESH project - congratulations 😉

Nevertheless, fixing it will have to wait until #5695 got approved and merged here. Otherwise we'll end up in a big mess and this migration PR will never finish. But I reckon this also shouldn't be much of a problem because it's nothing critical which prevents anybody from using it.

MHerbst commented 6 years ago

But I reckon this also shouldn't be much of a problem because it's nothing critical which prevents anybody from using it.

Exactly, it's more of an ugliness then a big problem. I had already suspected that it might be a problem with the dynamic creation of the thing types.

tavalin commented 6 years ago

Also 'Unknown' in 'Unknown device' is incorrectly spelt as "Unkown" although I've seen that across a number of different things so is probably the default behaviour rather than something in the binding.

sjsf commented 6 years ago

Haha, good point -> #5741

By the way, the place were the message comes from only proves that the thing type is not known to the PaperUI at that very moment in time.