Humming birds have a remarkable ability to conserve energy throughout the day, but that can also leave them exhausted at night. They need a good night's rest in order to wake up refreshed and ready for another long day of flying, hunting, and feeding.
Unfortunately, due to their small size and heightened metabolic rate, hummers are at particular risk in the cold. At night they must lower their body temperature and metabolism in a process known as torpor, which is similar to hibernation in other animals. During torpor, a hummingbird's metabolism drops and its heartbeat slows significantly. The birds can even drop into a deeper level of torpor, although this is less common.
While this may seem like a death-like state, it is actually a very beneficial way for the birds to get the rest they need. When a bird enters a deep state of torpor, it will not wake up easily, and they can end up hanging upside down on a branch or perch, making them look dead. It can take up to a minute for them to fully awaken from this state of torpor, so if you see a hummingbird at night that is hanging upside down or appears to be "dead" don't worry; it is simply getting a good sleep.
While hummingbirds usually sleep alone, they have been observed roosting together at times in shrubs and trees that provide some shelter from the elements. They will often choose a spot near their nests or hummingbird feeders, taking advantage of the constant supply of food and slightly warmer microclimate these locations offer.