The present invention relates to a method performed by a light assembly (100) of tracking livestock inside of a building for keeping the livestock. The light assembly (100) is arranged above the livestock. The light assembly (100) comprises a light source (10), a camera (12), a controller (14) and a communication interface (16). The method controls (S100) the output of the light source (10) with the controller (14) such that a light condition inside the building is adapted to a diurnal rhythm of the livestock. The camera (12) retrieves (S110) a live view of the livestock in a field of view of the camera (12) and transmits (S120) with the communication interface (16) the retrieved live view of the livestock to a monitoring node (200).