[OH3 MainUI] is there a way to use group for actionAnalyzerItems?

I have a group item to calculate floor avg temperature (averaging room temperatures):

I would like to display all room temperatures (all items contained in the group) in chart when tapping on a button

          - component: oh-button
            config:
              action: analyzer
              actionAnalyzerItems: [gGF_Living_Hygrometer_Temperature, ...]

is there a way to use the group item for actionAnalyzerItems in order to display all items contained in that group? Something like

actionAnalyzerItems: gGF_Temperature_Average.members

or simply

actionAnalyzerItems: gGF_Temperature_Average

Thanks in advance!

1 Like

even since i’ts been a while:

actionAnalyzerItems:
  - myItem1
  - myItem2
  - myItem3

This is actually the same as

actionAnalyzerItems: [myItem1, myItem2, myItem3]

so one still needs to explicitly name all items - the question was if only one (group) item can be specified and all its children would be rendered …

wow, sorry i’ve really spend no time to read your post. :frowning:
Actually i’ve mixed up your post with another while i was searching for “actionAnalyzerItems” in the community.

But at least to answer your question a bit:
No since the individual items need to be passed to the analyzer, you need to specify them individually.
Maybe you can create an issue on github for this

Then you will get the issue of people who want to chart the group Items state, not its members (it’s an average, say)

A new property could be introduced i.e. actionAnalyzerGroupItem :wink:

I was just wondering when creating my widgets if there is a way to render each item within (avg) group without explicitly naming them again (already in group) … just a (potential) nice to have.

Absolutely. The old sitemap Chart widget, if given a Group, plotted all members on the one chart. From time to time, people grizzled because there was no option to plot the Group Item value only, it had to be worked around with a dummy Item.

Hi rossko57,

Do you have an idea, how the actionAnalyserItems metadata would be coded in textual .items file. I tried:

listWidget“oh-label-item“[action=“analyzer“, actionAnalyzerItems=“my-item- name“]

but this does not work.

Would you have any idea? Thank you in advance

I have no idea. Why would you want to code something about how to display some other Item, into an Item?

You have to specify which item is being analysed (i.e. which item is shown in the chart), when you press on the arrow (see picture). At the moment no chart is shown, when pressing on the arrow, since no item is selected

@ysc
sorry Yannick to ping you. Would you have an idea, how to code actionAnalyzerItems within the listWidget metadata in the textual .items file?

I don’t think you can, as values other than strings, number or booleans cannot be expressed in the textual description language (openhab-core/bundles/org.openhab.core.model.item/src/org/openhab/core/model/Items.xtext at 7de57f9ffe4eb5057d8c0bf6e78c538f54f69e73 · openhab/openhab-core · GitHub), while the JSON DB/metadata API allows arbitrary objects and arrays as values (openhab-core/bundles/org.openhab.core/src/main/java/org/openhab/core/items/Metadata.java at 7de57f9ffe4eb5057d8c0bf6e78c538f54f69e73 · openhab/openhab-core · GitHub).
One solution for this particular case could be to accept a simple string of comma-separated item names as an alternative to an actual array.

I feel honoured to get an answer from the master :blush:

This was exactly my thought, a comma separated list of items (i.e. strings). As I understand from you this is not possible yet (since I already tried this). Could you think of implementing this in the near future?

Hi Yannick

I don’t want to bother you, but I still wondering what you meant with your last sentence. Is the comma-separated item names something you are thinking to implement in the future, or is it already possible now?

Thanks a lot for a small hint on this

No it’s not possible right now, but yes eventually this will be done along with the dozens of issues I get in my inbox while I’m not in a coding mood :wink:
Feel free to file it at Issues · openhab/openhab-webui · GitHub

Hey Yannick

Thank you very much for your prompt answer. So I‘m relaxed as I cannot do much at the moment but wait.
As proposed by you i have filed an issue at github

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.