Background: Elderly healthcare is one of the important issues in an aging society. Smart homes in healthcare domain help the elderly to be continuously monitored, instead of being under supervision at expensive health centers, and hence enable them to live independently. This service requires detecting and monitoring of residents' normal activities of daily living in smart homes. Objectives: By profiling residents' behavior and identifying changes in normal activities of the elderly over time, one can detect anomalous behavior and determine whether their health status declines. Hence, the possibility of preventive care for some elderly people or providing assistance to the elderly will be partly provided in case of occurrence of the anomalies. Methods: In this paper, first a method was proposed for detection and prediction of elderly activities by extracting several features from available information. In the second step, statistical measures were applied on the features to profile the elderly's behavior. The AdaBoost learning algorithm was used for detecting the anomalies and modeling normal/abnormal behavior. Results: For detection and prediction of the activity, the proposed method was tested using a dataset collected in the "eHealth Monitoring Open Data Project". The accuracy of 98.48% was obtained by considering features of start time, end time, duration, location, previous action, water, and electric device use. Anomalous behavior was detected in the same dataset with the average f-score of 90%. Conclusions: Results of the present study revealed that, the proposed methods are effective for detecting abnormal actions of the residents in smart homes to a fairly good level. This enables the elderly to live independently while being under continuous monitoring and significantly reduces the elderly health care costs.