openhab / openhab-webui

Web UIs of openHAB
Eclipse Public License 2.0
218 stars 239 forks source link

[MainUI] missing channel icons #621

Open marcelrv opened 3 years ago

marcelrv commented 3 years ago

The problem

Channel icons are missing in most pages

In the item link page it is working well image

but most other places the icon (category) is lost image image

Expected behavior

If the channel icon is available, I would expect to see it, similar as it is showing for the channel in the channel page.

Your environment

Latest snapshot build 20201210

lolodomo commented 3 years ago

Maybe due to a bad category set by the binding? https://github.com/openhab/openhab-addons/pull/9335 What is the binding? Mihome?

marcelrv commented 3 years ago

It is from the miio binding. But I would be surprised that would be the issue as I'm the channel page it does pick up the right icons, and the items created from the channels get a working icon. ( Note the items you see in the screenshot are are auto created from the channel without further editing)

Skinah commented 3 years ago

I had a quick look at the binding and the brightness channel is defined as a Number type (in the commonChannels.xml file) and is being sent Dimmer/Setpoint commands ??? Perhaps it should be a Dimmer type and not Number?

Also the binding has lots of Number channels that have options defined which I was told not to do that when I had a binding get reviewed that did that. The channels should be String type if they have options not Number.

I suggest you raise this as an Addon issue to be looked at as I do not use the binding and am not an expert but it appears to be something that needs looking at.

lolodomo commented 3 years ago

For miio, I found that: https://github.com/openhab/openhab-addons/blob/7380b458115d80b9b6dec522f458771f3e4ba6b2/bundles/org.openhab.binding.miio/src/main/resources/database/huayi.light.pis123-miot.json#L60

marcelrv commented 3 years ago

@lolodomo yes I found during testing yesterday that indeed dimmablelight is deprecated. PR to fix that is in progress. The icon in the screenshot is light to though, but a dimmablelight.

@Skinah the example in the screen is from https://github.com/openhab/openhab-addons/blob/645032db5f47f91a1bb66de28930dfee3386b20e/bundles/org.openhab.binding.miio/src/main/resources/database/yeelink.light.lamp1.json#L60 The role is indeed dimmer. The channels are dynamically generated from the JSON file, not using the XML channel config. (To be precise: depending the JSON file)

Where do you see documentaries that all channels with options need to be string? That is not my experience. The XML needs to have a string in the definition, but the channel can be numeric is my experience.

Skinah commented 3 years ago

https://community.openhab.org/t/openhab-3-0-milestone-1-discussion/106330/281

ghys commented 3 years ago

The component that displays link details doesn't have the category info because it's defined by the channel type and all it has it the channel. https://github.com/openhab/openhab-webui/blob/9ea63a0085a8d82466e376b950e01398f3e8cfc5/bundles/org.openhab.ui/web/src/components/model/link-details.vue#L11 Not sure I care about this enough to fix it.