openhab / openhab-webui

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

Improve binding selection by filtering (including usage of binding metadata) #2050

Closed jlaur closed 5 months ago

jlaur commented 1 year ago

Seeing the nice results of #1997 I thought I'd finally suggest to use the new add-on metadata introduced in 4.0 to provide either filtering or additional search options.

I don't know if this is technically feasible, i.e. if the UI has access to these metadata when bindings are not yet installed. If not, please feel free to close this issue.

The problem

There is currently more than 350 bindings available which are shown in a long list per default:

image

It's possible to search by name, so it's not hard to find a specific binding.

Your suggestion

I'm not UI expert so I'm not sure exactly what would be the best suggestion here. But I will throw a few ideas anyway. πŸ™‚

I'm wondering if the metadata connection and country could be taken into consideration. Per default we could exclude bindings having countries declared where none of those countries match the country configured in regional settings. So for example, when in Denmark:

image

I would not see any of these:

$ grep -R "<countries>" | grep -v "dk"
bundles/org.openhab.binding.dsmr/src/main/resources/OH-INF/addon/addon.xml:     <countries>nl,be,lu,at</countries>
bundles/org.openhab.binding.hccrubbishcollection/src/main/resources/OH-INF/addon/addon.xml:     <countries>nz</countries>
bundles/org.openhab.binding.kvv/src/main/resources/OH-INF/addon/addon.xml:      <countries>de</countries>
bundles/org.openhab.binding.linky/src/main/resources/OH-INF/addon/addon.xml:    <countries>fr</countries>
bundles/org.openhab.binding.meteoalerte/src/main/resources/OH-INF/addon/addon.xml:      <countries>fr</countries>
bundles/org.openhab.binding.nzwateralerts/src/main/resources/OH-INF/addon/addon.xml:    <countries>nz</countries>
bundles/org.openhab.binding.sncf/src/main/resources/OH-INF/addon/addon.xml:     <countries>fr</countries>
bundles/org.openhab.binding.vigicrues/src/main/resources/OH-INF/addon/addon.xml:        <countries>fr</countries>
bundles/org.openhab.binding.windcentrale/src/main/resources/OH-INF/addon/addon.xml:     <countries>nl</countries>
bundles/org.openhab.binding.ecowatt/src/main/resources/OH-INF/addon/addon.xml:  <countries>fr</countries>
bundles/org.openhab.binding.freeboxos/src/main/resources/OH-INF/addon/addon.xml:        <countries>fr,it</countries>

However, maybe there could be a checkbox to see all when the UI knows something has been excluded. Certainly it should be possible to install any binding (I'm not suggesting geo-restriction πŸ™‚ at all), so there should be some simple way to bypass and see all.

Another small idea would be to allow filtering based on connection. I'm not sure how to consistently provide such an option in the UI, but I'm thinking if it could work the same way as GitHub issue/PR search (and to some extent Google) where you could add something like "connection:local" or "-connection:cloud" to exclude cloud. For example:

image

I realize this would be a quite hidden feature, so hopefully someone would have a better idea.

florian-h05 commented 1 year ago

Nice proposal, however unfortunately country and connection info are not available if the addon is not installed, see https://github.com/openhab/openhab-core/issues/3795.

jlaur commented 12 months ago

I have extracted one of the suggestions into #2170.

jlaur commented 11 months ago

@florian-h05 - is it correct that with the new add-on suggestion feature, it would now be possible to search/filter by connection and country?

florian-h05 commented 11 months ago

I guess yes. I haven't looked into which data the API returns for installed add-ons yet ...