I’ve got three sensors I want to take an average temperature of at that point (so their current readings). To give me a “house average” point, so I can then work with it.
I’ve made a new group for them (a subset of the main temperatures group). Now working on the average.
I assume I could just make a rule that iterates over that group, counts the number of items, adds them together and divide by the number and push it into a new item.
I guess I’m wondering if there’s a one line/item only way of doing it. Persistence is on at the higher temperature group (each reading goes into it’s own table).
So given the above group defintions and items my item should be: Group:Number:AVG g_temperature_average "Average Temperature [%.1f °C]" <temperature> (g_temperature)
And if I want it in the sitemap, i use: Text item=g_temperature_average
For example?
You may need to restart OH after making all of these changes for everything to work as it should. There is some weird behavior with Groups in OH right now.
I had a play and did is as rule as well, just to further rule coding.
For persistance strategies, this would be valid in cron, but seems to get an error in openhab:
every15Mins : "*/15 * * * * ?"
is the / not allowed? Seems to complain of a mismatched delimiter