Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: BasicUI: Item sort order in groups #76

Open
stefanhaustein opened this issue May 31, 2019 · 20 comments

Comments

@stefanhaustein
Copy link

commented May 31, 2019

Hi, I am quite happy with the Basic UI in general... However, it would be great if group items would be ordered by label by default.

Supporting sorting by any property would be even better (I have seen a forum entry where somebody wanted to sort a group of 100 items by battery level), but label should be a very good starting point / default.

@bjoernbrings

This comment has been minimized.

Copy link

commented Jun 1, 2019

For me it was initially sorted in the order items were created. But that got destroyed at any point in time and now it seems to be quite random.
Anyways I'd go for an initial order (not knowing whether that is possible ...). Disadvantage may be items that are later added always go to the end.

@stefanhaustein

This comment has been minimized.

Copy link
Author

commented Jun 2, 2019

Creation order seems dangerous to me: users will be tempted to delete and re-create items to get a desired order, causing frustration. Label seems to be a simple default that should be immediately obvious to users.

@kaikreuzer

This comment has been minimized.

Copy link
Member

commented Jun 2, 2019

Sitemap sorting is done by order - specifically by the order of items in the items file.
@bjoernbrings If this is broken, it should be fixed, because many setups rely on it.
Anyone else that wants a different sorting is usually anyhow better off to detail out the sitemap and not use the dynamic groups.

@stefanhaustein

This comment has been minimized.

Copy link
Author

commented Jun 2, 2019

How does one establish the items file order with the Paper UI?

@kaikreuzer

This comment has been minimized.

Copy link
Member

commented Jun 2, 2019

The same way you define a sitemap with the Paper UI: Not at all ;-)

@stefanhaustein

This comment has been minimized.

Copy link
Author

commented Jun 2, 2019

Not sure what the smiley means? If this is supposed to be some form of joke, I don't get it?

Is editing files somehow the preferred way? Is this a missing feature in Paper UI?

@kaikreuzer

This comment has been minimized.

Copy link
Member

commented Jun 8, 2019

No, not meant to be funny - it is just how it is and I would indeed prefer if everything could be done through the UI, but we are not there (yet?)...

Is editing files somehow the preferred way? Is this a missing feature in Paper UI?

We have some comparison of the different options at https://www.openhab.org/docs/configuration/#versatility

While discovery and thing management is quite convenient through Paper UI, item management is highly recommended to be done textually, especially once setups become bigger and more complex.

@stefanhaustein

This comment has been minimized.

Copy link
Author

commented Jun 10, 2019

If just adding label order is not an option, I think there are three basic alternatives:

  • Add an "order by" property to Group items. In my opinion, this would be the best option. If one cares more about functionality than presentation, this would enable group hierarchies replace sitemaps
  • Add an "order by" property to UI groups
  • Enable Paper UI to define the item order (just establishing parity with text file capabilities)
@DigiH

This comment has been minimized.

Copy link

commented Aug 26, 2019

I am also sorely missing the broken sitemap group ordering. All my items are definded in an items file, and the current random ordering is very unfortunate.

While new options will be needed for items created through the Paper UI, it would be great to have the expected behaviour reinstated for items definded in items files.

Additionally I just realised that this also messes up any group charts. Especially anoying if two related charts are shown together - in my case temperature and humidity for various rooms, with the rooms in different order and hence different colours.

@lolodomo

This comment has been minimized.

Copy link
Contributor

commented Aug 31, 2019

All my items are only defined in a file and Basic UI and Android App are showing members of groups in the order they are declared in my file.

@DigiH

This comment has been minimized.

Copy link

commented Aug 31, 2019

@lolodomo - All my items are also only declared in files (openHAB 2.4) and do show up members of groups in random order when putting groups in my sitemaps.

What happens when you make changes/additions to the files where your group members are definded?

While I have manually changed this for group member items in sitemaps, unfortunately there is no manual fix for group charts :(

@lolodomo

This comment has been minimized.

Copy link
Contributor

commented Aug 31, 2019

I never change my config files without restarting OH.
Does your problem only occur when updating your item file (and not restarting openHAB) ?

@DigiH

This comment has been minimized.

Copy link

commented Aug 31, 2019

No, it also happes when restarting openHAB. @bjoernbrings @kaikreuzer - Should this have been fixed in 2.4, or are you still seeing the same issues as me? I'm unsure now, hearing the different experiences in this thread

@ lolodomo - are you running openHAB 2.4 Release Build as well?

@lolodomo

This comment has been minimized.

Copy link
Contributor

commented Aug 31, 2019

No I am running a 2.5 snapshot but I never encountered this issue with all 2.x versions I run in the past.
Can you provide files to reproduce the problem ? Maybe it is linked to the way you define your groups or your sitemap.

@DigiH

This comment has been minimized.

Copy link

commented Aug 31, 2019

It must definitely be a display dependant loading issue into the json database files, which obviously does happen, even if all items are defined manually.

I just copied all the group member item definitions from the original items file into a new file, commented them out in the original, and added the new items file. Now they all show up in the newly created expected order.

Not an ideal hack, as I would prefer to have these items together with their related items in the original items file, but ok for a working hack until this issue is addressed in a future build.

Just testing to see if this also survives a restart of openHAB - will report back in 30 minutes.

@DigiH

This comment has been minimized.

Copy link

commented Aug 31, 2019

The above mentioned hack doesn't survive a restart, but reloading the newly created items file after a startup does show the group members in the order of the items file again.

Not really sure how a load at startup differs internally form just reloading the new items file again right after the startup, especially since the new file was actually loaded last during the startup - but it does make all the difference.

@lolodomo

This comment has been minimized.

Copy link
Contributor

commented Aug 31, 2019

You mean you have items in config files + items defined in Paper UI ?

@DigiH

This comment has been minimized.

Copy link

commented Aug 31, 2019

ALL my items are defined in manually configured .times files.

They must get loaded into the same database with openHAB 2, which would also contain items created in the Paper UI, as manually defined items (and Things etc. for that matter) also do show up in Paper UI with all their properties showing up nicely.

This loading from manually defined items, as described above, does not guarantee the order of items in the items file to be the order when having groups in a sitemap, but seems to be hackable by manually reloading and items file with JUST the affected group items after startup.

I only have just above 50 items which are relevant to this issue, but knowing that others rely on groups for their whole sitemap setups, they might be sticking with openHAB 1.8 until this is addressed.

@lolodomo - do you have your group items sequentially in your items files, or are there other non-group items in between them?

@lolodomo

This comment has been minimized.

Copy link
Contributor

commented Aug 31, 2019

I have non group items.

@stefanhaustein

This comment has been minimized.

Copy link
Author

commented Sep 13, 2019

No, not meant to be funny - it is just how it is and I would indeed prefer if everything could be done through the UI, but we are not there (yet?)...

So hypothetically, how could it be done there in the future and how would this be represented in data?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.