The role of rhythms in homeostasis