Abstract-Current technologies for Home and Building Automation (HBA) basically require an explicit interaction with the user and allow a static set of operational scenarios defined during system implementation. On the contrary, novel HBA solutions should enable so-called ambient intelligence, deriving from a flexible and automatic control of appliances and subsystems dipped into an environment. To this aim, this paper proposes backward-compatible enhancements to one of the most widespread domotic standards, i.e., EIB/KNX ISO/IEC 14543-3, able to support advanced, knowledge-based and context-aware functionalities, grounded on the semantic annotation of both user profiles and device capabilities. Such an approach enables novel resource discovery, matchmaking and decision support features in HBA. Main benefits are in: (i) determining the most suitable services/functionalities according to implicit and explicit user needs, (ii) allowing device-driven interaction for autonomous adaptation of the environment to context modification. A case study is presented to better clarify the proposed framework also highlighting main characteristics, while performance evaluation is provided to assess its effectiveness.