Most animals avoid adverse temperatures; however, the molecular basis of this response is poorly understood. In Drosophila melanogaster, both internal and external 'warmth sensors' have been proposed. Here, the authors characterize the molecules that confer thermal sensitivity to hot cell (HC) neurons, the external warmth sensors. They found that the gustatory receptor Gr28b is expressed in HC neurons and is responsible for the rapid withdrawal of flies from a steep thermal gradient. This complements the function of Transient receptor potential A1, which is expressed in internal thermosensory neurons and controls the behavioural response to shallow thermal gradients.