Sure
That’s a good question, since the solution is not that obvious in openHAB3
When checking the documentation for aggregation functions you may have noticed the COUNT()
aggregation:
Unfortunately, the COUNT() aggregator is not selectable in the MainUI of openHAB3.
BUT: You can work around that limitation by importing group items with COUNT() aggregators from textual configuration:
This essentially adds two groups where one counts for empty and another count for good batteries.
A third group simply sums up the both which provides me the total number of batteries:
NumOfEmptyBatts + NumOfGoodBatts = TotalNumOfBatts
All BatteryLow-items belong to both count-groups - that’s it