There is a small fan that pulls sample air over the temperature sensor. The fan is located in various places on different 124 models, but it is probably behind and to the right of the glovebox. It should run any time the ignition key is on.
To test it, hold a cigarette(yuk!) or other source of smoke near the small grill near the rear view mirror. The smoke should be sucked into the grill when the ignition key is on.
If this fan is not working, you will have cooling at strange times.