well it was obvius that they liked each other in the 4th book,and harry 说 he had an inkling it might start happening and he didnt know it would messup the friendship 或者 be to embarresed if they start snogging (kissing)in public, while in herbology.
Of course he knew. He was perfectly aware of it from Goblet of 火, 消防 on. He just thought it was none of his business, 或者 found it weird 或者 was (rightfully) afraid how it might affect their friendship. Plus he was also a little jealous, after all what if the two of them got together and he'd be the fifth (this case third) wheel and he'd be left out and alone.
I think that he kind of knew during the 4th book. because ron got really jelouse, and then she 说 that 下一个 time he should ask her out befor anyone eles so he would not be that jelouse