I am looking for a way to show on my sitemap the average value for ,lets say, my temperature sensors. I have all my sensors under the same group “temperature” so I kinda thought that this would work:
Group:Number:AVG Temperature "Avg. Room Temperature [%.1f °C]" <temperature> (Status)
Ive been looking. and I can’t find anything, or I just don’t understand enough to notice it. The only thing I can find is what I posted, and it doesn’t work plus im not sure if I understand it correctly. If someone could interpret what I have to see if that is even correct or the right path that would be great, or if you know where in the wiki I can look specifically, I can re-read, but I have been searching and can’t find anything.
Group:Number:AVG **Temperature** "Avg. Room Temperature [%.1f °C]" <temperature> (Status)
The Temperature is the group that it averages the values for, and in the parenthesis is what? I have tried different variations and none of them give me a value.
I´m afraid I´m being dense atm, but I don´t get it …
You said, i hope I´m putting it right, that in the items configuration should be this
Group:Number:AVG Temperature “Avg. Room Temperature [%.1f °C]” (Status)
The “(Status)” the end means, that this group is a member of group “Status”, right ?
My temp-sensor items are configured like this
Number itmTempEGWZ “Temperature [%.1f °C]” (Temperature) { knx=“4/0/6+<4/7/1” }
…
and in sitemap (basicui for me) this:
Text item=Temperature
Text item=itmTempEGWZ
…
The items, that are supposed to show me single room temps are working correctly, but the average doesn´t work
So the (Status) in my case sets this Item for the average to a group called status. I used this to track all my averages in a single group that I could call anywhere in my sitemap.
So for your item EGWX you have it set to a group called Temperature, this is the same as mine. So if you copied my example it should be averaging all values in the temperature group to a number and assigning that to a group called status.
MAKE SURE YOU DO NOT HAVE TEMPERATURE BEING DEFINED AS A GROUP ANYWHERE ELSE. See what LexLuther has shown as he commented out the Group Temperature (ALL)
And then I think you show the average value in your site map by doing Group item=Temperature.
Edit: Forgive me a little, as I haven’t really touched OpenHAB since last June after I graduated. I have been meaning to copy over what I had developed for my own personal use by I haven’t had the time or money to gather the resources I had while I as in school. I do have all my items/sitemaps files and such if maybe that would help you?
One more remark for all, who are trying the group function and stumble on this discussion:
The functions do not work with nested groups.
One has to declare the membership of each item one wants to include in the group the function should operate on.
(Lazy thinking and declaring a group to be part of the group where the function should work on doesn’t work… )
Hey sorry I never responded to you. This was for a project I completed way back when and I just stumbled across this due to mdnx comment below.
I tried to go back to my code and to look at what you had but I can’t figure out why it wouldn’t work the same. That being said I haven’t used Openhab in over a year now. Sorry bud.