This paper addresses the problem of learning the Activities of Daily Living (ADLs) in smart home for cognitive assistance to an occupant suffering from some type of dementia, such as Alzheimer's disease. We present an extension of the Flocking algorithm for ADL clustering analysis. The Flocking based algorithm does not require an initial number of clusters, unlike other partition algorithms such as K-means. This approach allows us to learn ADL models automatically (without human supervision) to carry out activity recognition. By simulating a set of real case scenarios, an implementation of this model was tested in our smart home laboratory, the LIARA.