In summer, many temperate bat species use daytime torpor, but breeding females do so less to avoid interferences with reproduction. In forest‐roosting bats, deep tree cavities buffer roost microclimate from abrupt temperature oscillations and facilitate thermoregulation. Forest bats also switch roosts frequently, so thermally suitable cavities may be limiting. We tested how barbastelle bats (Barbastella barbastellus), often roosting beneath flaking bark in snags, may thermoregulate successfully despite the unstable microclimate of their preferred cavities. We assessed thermoregulation patterns of bats roosting in trees in a beech forest of central Italy. Although all bats used torpor, females were more often normothermic. Cavities were poorly insulated, but social thermoregulation probably overcomes this problem. A model incorporating the presence of roost mates and group size explained thermoregulation patterns better than others based, respectively, on the location and structural characteristics of tree roosts and cavities, weather, or sex, reproductive or body condition. Homeothermy was recorded for all subjects, including nonreproductive females: This probably ensures availability of a warm roosting environment for nonvolant juveniles. Homeothermy may also represent a lifesaver for bats roosting beneath loose bark, very exposed to predators, because homeothermic bats may react quickly in case of emergency. We also found that barbastelle bats maintain group cohesion when switching roosts: This may accelerate roost occupation at the end of a night, quickly securing a stable microclimate in the newly occupied cavity. Overall, both thermoregulation and roost‐switching patterns were satisfactorily explained as adaptations to a structurally and thermally labile roosting environment.