Ambient Intelligence is an emerging technology that allows for reasoning of activities that are carried out in a smart environment. Smart sensors play a vital role in activity recognition tasks. Though a great number of sensors provide more pinpointed information about where and when the interaction in the environment occurred, addition of sensors also results in higher power consumption and greater cost constraints. The number of training samples used for activity recognition tasks also increases and becomes computationally expensive. Thus, to overcome these constraints sensor optimization in smart environment is carried out. Mapping of sensors to a user's activity becomes tedious when more than one activity is carried out at the same timestamp. Unambiguous sensor-activity relationship is derived with the help of spatial and temporal context represented by ontology model that captures real time sensor data. Since there exits spatial noise during activity annotation process, it is eliminated with help of pointwise mutual information score. Spatial and temporal data of an activity helps sensor optimization in multi resident living with concurrent activity occurrence. Inactive sensors are removed using mutual information score and redundant sensors are contextually paired based on where an activity happens. By doing so, only unique set of sensors are paired every time even when concurrent activity occurs. The quality of features derived is tested by testing the accuracy of the model by activity recognition task using Random Forest algorithm. Nearly 24% of sensors were identified as inactive in the smart environment. The accuracy of Human Activity Recognition (HAR) task remained constant even after removing the inactive sensors. Addition of spatial context helped to improve HAR with increased accuracy. Contextual pairing of redundant sensors resulted in minimal drop in the model's accuracy.