Reliable control of mixing valves in heating or cooling systems