He is probably just trying to thermoregulate his bodytemp. My chameleon does this sometimes too even though he is in the shade. We live in hot climates and sometimes it is still hot in the shade. On another note, sometimes they will open their mouths if they are having trouble getting air, due to a respiratory infection. Not saying that is what it is though. Can you hear him breathing funny, like a popping noise? Does he have any thick saliva in his mouth that looks real stringy? Are there any bubbles coming out of his mouth? If he does not have any of those symptoms, then he is probably just cooling off! When is the last time he ate?