Power sharing model for energy communities of buildings