openhab / openhab-core

Core framework of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
912 stars 421 forks source link

Inline group members instead of a subpage #4322

Open mueller-ma opened 2 months ago

mueller-ma commented 2 months ago

Is your feature request related to a problem? Please describe.

Sometimes I want a Sitemap page to contain all members of a group and an additional widget. Example: One page for controlling all roller shutters. This includes the members of the group where all roller shutters are in, but also a "settings" Switch item that enables automatic up/down based on daytime. A rule reads the switch and acts corresponding.

Currently my code looks like:

Text label="Roller shutters" {
  Switch item=RollerShutterAutomatic
  Switch item=RollerShutter1
  Switch item=RollerShutter2
  Switch item=RollerShutter3
}

That's some copy+paste work and requires maintenance when the group members change.

Describe the solution you'd like

Add a new property to allow the same page with the following code:

Text label="Roller shutters" {
  Switch item=RollerShutterAutomatic
  Switch item=GroupRollerShutters layout=inline
}

Additional context

The new property can be the same as in my suggestion in https://github.com/openhab/openhab-core/issues/4308:

inline only makes sense for Groups, though. It can be resolved server-side, so no change is required in the clients.

Coordination between maintainers

Notify maintainers of other UIs: @openhab/webui-maintainers @openhab/android-maintainers @openhab/ios-maintainers

Checklist for implementation:

jimtng commented 2 weeks ago

fyi I achieved this by generating the sitemap

lolodomo commented 4 days ago

Very probably not so easy to implement due to the generation of IDs for updates in group pages.