The emerging availability of already deployed sensors that can be utilized for activity and context recognition raised a new paradigm. This paradigm called opportunistic sensing utilizes the available sensing infrastructure for activity and context recognition. This work focuses on utilizing this dynamically varying infrastructure to recognize high-level composed activities. The proposed method uses activity relations modeled in an ontology to dynamically configure Hidden Markov Models (HMM) capable of detecting activities and context. The dynamic creation of the HMMs is directed by the recognition purpose of the activity and context recognition system. The recognition purpose is expressed in form of a semantic abstracted, high level recognition goal. This flexible way of directing the dynamic configuration of an activity and context recognition system during runtime follows the opportunistic sensing approach. The constructed HMM relies on the recognition purpose of the system and the configured sensing ensemble on the underlaying and available sensing infrastructure. This enables the dynamic configuration and adaption during runtime of the activity and context recognition system to detect composed and time sequenced activities using HMMs in an opportunistic way.