We've heard from many people over the years thinking (incorrectly) that their vehicle's automatic headlights are controlled by the rear view mirror in the vehicle...let's set the record straight, the sensors located on the vehicle's rear view mirror housing ARE NOT for the vehicle's automatic headlight feature. What you see on the back of the mirror housing is an ambient light sensor, and the mirror uses this sensor, along with the rear-facing light sensor to determine if the glass should dim and how much.
Here's an example of the ambient light sensor that is located on the back of an auto dimming mirror (styles may vary, some have a lens, older ones don't):
On vehicles that have an automatic headlight option, the sensor for this is commonly located somewhere on the top of the dash, but the location and styles vary. Here's an example of an automatic headlight sensor on a GM truck:
Now...with that said, there are some mirrors that have other sensors attached, but these are usually part of the mirror bracket itself. Rather, they aren't sensors, but instead various types of cameras - some of these are used to automatically dim the high beams when the camera "sees" another vehicle coming toward yours. Other cameras are used for lane keep assist systems / lane departure warning systems, and so on. Here are but two examples of such cameras:
There you go - hope this clears up the long standing confusion on these mirrors & automatic headlights!