A semantic-based framework for energy management in Home and Building Automation scenarios