Controlling the flow of heating or cooling liquid