Animal behaviour is shaped through interplay between genes, the environment and previous experience. As in mammals, satiety signals induce quiescence (sleep) in Caenorhabditis elegans. We have identified that the ETS-5 transcription factor, orthologue of mammalian FEV/Pet1, controls satiety-induced quiescence. Nutritional status has a major influence on C. elegans behaviour. When foraging, food availability controls behavioural state switching between active (roaming) and sedentary (dwelling) states. When provided with high-quality food, however, C. elegans become sated and enter quiescence. Our data suggest that ETS-5 controls these behavioural states by setting the internal satiety quotient through fat regulation. Acting from sensory neurons, ETS-5 functions in a complex network with serotonergic and neuropeptide signalling pathways to control food-regulated behavioural state switching. Finally, we show that genetic and chemical control of quiescence through fat storage is reversible such that it may aid the development of appetite-controlling interventions.