a, Schematics of activating P2 neurons for 1 day of group enrichment/social isolation. 22°C treatments (no thermoactivation) were used as controls. Flies in group enrichment/social isolation were kept at 28°C for 1 day to thermally activate P2 neurons. After 1 day of thermal activation (or no activation), sleep or feeding behavior was measured at 22°C. b, Quantification (Mean±SEM with individual data points) of daily total sleep, daytime sleep and ZT0-4 sleep for experimental and heterozygous control flies grouped or isolated for 1 day with (28°C) or without (22°C) thermal activation of P2-GAL4 labelled neurons (N= 28–32 animals). c, Quantification (Mean±SEM with individual data points) of daily total food consumption, daytime food consumption, and ZT0-4 food consumption for experimental and heterozygous control flies grouped or isolated for 7 days with (28°C) or without (22°C) thermal activation of P2-GAL4 labelled neurons (N=22–57 animals). For b–c, two-way ANOVA were used for detecting interactions between temperature treatment and group/isolation status. Šidák multiple comparisons tests were used for post-hoc analyses between group treated and isolated animals of the same genotype and temperature treatment, *P<0.05, **P<0.01, ***P<0.001, ****P<0.0001. For N and P values, see the Source Data.