I’m designing groups / items structure in my OpenHAB system.
Following the guide about group definition, I defined two parallel tree of groups. One from a physical view and the other one from a logical point of view.
So, for example, I created the gGroundFloor group which contains gKitchen and gLivingRoom. Then I created gSensor group which contains gTemperature group.
In this way I can get the average temperature of entire home, using the value stored in gTemperature group.
But, how can I get the average temperature of the ground floor? I have to define a group called gGroundFloorTemperature or there is a more elegant way?
Creating a ground floor group IS the elegant way I’m afraid. This is why I don’t personally see the benefit of creating such a rigorous hierarchy of Groups for my whole home automation. Instead I create these Groups as I need them. As you can see, you number of needed groups is going to explode and you may actually user less than half of them.
I do support the dual hierarchies though. Just don’t go too far out of your way implementing everything until you have a need to.
Thanks for your reply.
So, if I understood well, you suggest me to create the “aggregation groups” only when I need them and not during the design phase.
In this case, I will add gGroundFloorTemperature, gFirstFloorTemperature, etc etc as long as I need them for aggregation needs
Instead of creating “aggregation” groups, i was also thinking to create global variables managed by rules and events…can it be a good solution?
Pretty much. I prefer to do these sorts of things as needed instead of up front.
It is a viable approach, but it will be easier and much less code to use Groups compared to Rules for this.