Of the many type of sensors it's probably a thermistor - fairly inexpensive - resistance changes with temperature. And since they have changed the mirror assembly already then it points to a problem with a connector/contact/resistance that is changing slightly with temp or vibration. Mirrors aren't heated on a 2012/focus?
Member of the Dropped Valve Seat Club.
Replaced #4 Piston, Rings, Rod+Bearings, AERA Re-Manufactured Cylinder Head and a light Hone. Then CLEANED the hell out of everything.