Research shows that hummingbirds have an active sense of smell and can smell their way out of danger while hunting for nectar. This is due to in part to their large olfactory bulbs, which is the tissue in the brain that controls smell.
For their experiments, scientists observed more than a hundred hummingbirds in the wild and in aviaries. The birds were given the choice between two feeders, either sugar water or sugar water plus one of several chemicals whose scent signaled the presence of an insect.
Results show that the hummingbirds avoided the water with the acid and that they can use their sense of smell to avoid danger while foraging for food.
Ref: https://www.sciencedaily.com/releases/2021/09/210906091001.htm