# Feature Request: Configurable Sorting for oh-repeater

**URL:** <https://community.openhab.org/t/feature-request-configurable-sorting-for-oh-repeater/171080>\
**Category:** Features\
**Created:** [November 26, 2026, 11:45am UTC](https://community.openhab.org/t/feature-request-configurable-sorting-for-oh-repeater/171080 "2026-11-26T11:45:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hr3](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/48db29/32.png) [@hr3](https://community.openhab.org/u/hr3)\
**Post date:** [November 26, 2026, 11:45am UTC](https://community.openhab.org/t/feature-request-configurable-sorting-for-oh-repeater/171080/1 "2026-11-26T11:45:00Z")

</div>

**Component:** `oh-repeater`

**Description:**

The `oh-repeater` should support configurable sorting when using `sourceType: itemsInGroup`.

Currently, items are sorted alphabetically by ItemName by default. It would be useful to have an additional option to preserve the original definition order of items.

**Proposed configuration:**

yaml

```auto
- component: oh-repeater
  config:
    for: item
    sourceType: itemsInGroup
    groupItem: gPV
    sortBy: definition
  slots:
    default:
      - component: oh-label-item
        config:
          item: =loop.item.name
          title: =loop.item.label

```

**Requested sorting options:**

- `name`: Alphabetical sorting by ItemName (current behavior).
- `definition`: Preserve the order in which items are defined in the openHAB item configuration.

**Goal:**

Provide more control over the display order of items in MainUI, especially for groups where items have been deliberately defined in a specific order.

The current default sorting behavior should remain unchanged for backward compatibility.

---

<div class="post-metadata">

**Author:** ![hmerk](https://community.openhab.org/user_avatar/community.openhab.org/hmerk/32/56432_2.png) [@hmerk](https://community.openhab.org/u/hmerk)\
**Post date:** [November 26, 2026, 12:00pm UTC](https://community.openhab.org/t/feature-request-configurable-sorting-for-oh-repeater/171080/2 "2026-11-26T12:00:14Z")

</div>

This can already be achieved by using:

```yaml
fetchMetadata: widgetOrder

```

If the widgetOrder is set in MainUI, it will be used for sorting.  
As an example, you can check the floors menu in semanticHomeMenu.

---

<div class="post-metadata">

**Author:** ![AlbertoP57](https://community.openhab.org/letter_avatar_proxy/v4/letter/a/97f17d/32.png) [@AlbertoP57](https://community.openhab.org/u/AlbertoP57)\
**Post date:** [November 26, 2026, 4:59pm UTC](https://community.openhab.org/t/feature-request-configurable-sorting-for-oh-repeater/171080/3 "2026-11-26T16:59:13Z")

</div>

Thanks! Regarding a related issue, I was just about to give up and look for a JS-based solution when @hr3’s post appeared … immediately I’ve given it a like.

Lets say that it wasn’t easy to find the right way to achieve what one wants…

This is everything the documentation says about fetchMetadata:

![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/d/0/d047b9f7f98d0cc939b8a579c9eb9041bfe143e3.png)

Really hard to understand to me 😅

Following your suggestion, I looked for the metadata:

> **[Item Metadata - Items](https://www.openhab.org/docs/concepts/items.html#item-metadata)**
>
> openHAB has a strict separation between the physical world (the "Things", see below) and the application, which is built around the notion of "Items" (also called the virtual layer). | a vendor and technology agnostic open source automation software...

where the “alexa” example is like a ray of light in the darkness.😂

In the end, this is what I added to the item channels:

![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/5/c/5cf2e124b20d68352063dd5039e3d4f22a28d55b.png)

And it works for me. Still, I agree with the author of the post: default automate sorting even by position could be an idea. And, ideally, it should be documented. 😉

Thank you
