Activity clustering and recognition is one of the most important research trends about smart home. Taking place inside a sensor smart home, activities differ from each other at typical characteristics such as sensor sets triggered as well as temporal ones. In this work, we present a smart home infrastructure and propose a method of calculating neighborhood radius for clustering and recognizing in-home activities based on temporal characteristics. Experiment results show that the new method is proved to be easier and more flexible in finding neighborhood radius for clustering than the original DBSCAN algorithm and helps to generate several times as many smart contexts for activity recognition and next-activity forecast as the clustering results reported in Enamul Hoque et al 's research work.