Services in large smart environments, as defined in this paper, are "aware" of their users' contexts and goals and are able to automatically interact with one another in order to achieve these goals. Unfortunately, interactions between services (i.e., service conversations) are not necessarily compatible, as services could have different interfaces (i.e., signature incompatibilities), as well as different logic for message ordering (i.e., protocol incompatibilities). Such conversation incompatibilities create obstacles for achieving semantic interoperability of services. One approach for handling conversation incompatibilities is to use conversation adapters, which should be created automatically by the middleware in order to be able to support on-demand conversation customization. Existing approaches for automatic adapter generation are strictly limited as they require no changes at the interface level. To overcome such a limitation, this paper proposes a novel ontology-based context-sensitive approach for automatic adapter generation. This approach captures the aggregate conditional substitution semantics of application-domain concepts in a context-based manner and uses these semantics to determine the mappings between the different conversation messages and to generate the corresponding conversion functions. The proposed approach ensures service semantic interoperability and increases the chances for service reuse, which consequently improves the efficiency of the smart environment.