Before you replace anything find out the values like was pointed out. Also notice the grill on the sensor in the upper console. Take a piece of tissue and see if the airstream holds it to the grill with the A/C running. If the little tiny aspirator fan fails the sensor gets all the heat from the roof instead of properly being cooled by the airstream the little fan provides.
Without air movement the sensor doesn't see the real inside air temp, especially with the sun beating down.
Bosch Master, ASE Master, L1
33 years MB technician