[SOLVED] How can I display a group's SUM value in a sitemap?

  • Platform information: Raspbian
    • Hardware: Raspberry PI 3

    • OS: Linux garden-control 4.19.40+ #1217 Tue May 7 17:02:54 BST 2019 armv6l GNU/Linux

    • Java Runtime Environment: openjdk version “1.8.0_202”
      OpenJDK Runtime Environment (Zulu8.36.0.152-CA-linux_aarch32hf) (build 1.8.0_202-b152)
      OpenJDK Client VM (Zulu8.36.0.152-CA-linux_aarch32hf) (build 25.202-b152, mixed mode, Evaluation)

    • openHAB version: openHAB Distribution Version Information

build-no : Release Build
online-repo : https://dl.bintray.com/openhab/mvn/online-repo/2.4

Repository Version

openhab-distro : 2.4.0
smarthome : 0.10.0.oh240
openhab-core : 2.4.0
openhab1-addons : 1.13.0
openhab2-addons : 2.4.0
karaf : 4.2.1

  • Issue of the topic: please be detailed explaining your issue
    I do not know how to access the SUM of a so defined GROUP Item in a sitemap .
    When I click at the group item I get all the values.
  • Please post configurations (if applicable):
    • Items configuration related to the issue
Group:Number:SUM ForecastRainVolumesGroup "Forecasts from 03-24 hrs in the future"
Number:Length LocalForecastHoursRainVolume03  "Rain volume for  3 hours [%.2f %unit%]" <rain> ( ForecastRainVolumesGroup )  { channel="openweathermap:weather-and-forecast:api:local:forecastHours03#rain" }
Number:Length LocalForecastHoursRainVolume06  "Rain volume for  6 hours [%.2f %unit%]" <rain> ( ForecastRainVolumesGroup )  { channel="openweathermap:weather-and-forecast:api:local:forecastHours06#rain" }
Number:Length LocalForecastHoursRainVolume09  "Rain volume for  9 hours [%.2f %unit%]" <rain> ( ForecastRainVolumesGroup )  { channel="openweathermap:weather-and-forecast:api:local:forecastHours09#rain" }
Number:Length LocalForecastHoursRainVolume12  "Rain volume for 12 hours [%.2f %unit%]" <rain> ( ForecastRainVolumesGroup )  { channel="openweathermap:weather-and-forecast:api:local:forecastHours12#rain" }
  • Sitemap configuration related to the issue

    Group item=ForecastRainVolumesGroup

    • Rules code related to the issue
      None so far since I do not know how to do it
    • Services configuration related to the issue
  • If logs where generated please post these here using code fences:

The elements on the sitemap tell it how you want it to be displayed and is unrelated to the type of the Item for the most port. When you put ForecastRainVolumesGroup on the sitemap using Group, you are telling it to open a subframe with all the members shown. To see the value of ForecastRainVolumesGroup itself, use a Text element.

Here’s a cunning plan:

Text item = myGroup {
   Text item=memberItem1
   Text item=memberItem2

Will display the group value on a line, which line is clickable to see any members you select

Thank you, but I already get the single values of the group when clicking on it.this when clicking on it.
What I am looking for is to display the sum of alle .state values of the members of the group.

Since there are alle numbers there must be a solution

Thanks, this is working but am looking for all members’ state sum

Well, you have to format your number as well.
See your Item’s “label [%.2f %unit%]” and compare with your Group label

I certainly missed taht, I’ll give that asap. Many Thanks

It’s working now!
Thanks a lot for all the proposals - especially yours, rossko57.
The obvious just escaped me: I just missed to put a format specifier in the label.
Everything else has been correct so far.

Loooking forward to get some more experience and maybe I could help out the community as well
Best Regards


1 Like

Thanks ( Pls.see my last reply)