Chameleons have a "3rd eye" or parietal eye to help them sense where light is coming from. It's merely a photosensitive area that usually looks like a single lighter scale in the center top of their head. It's much more visible in iguanas and some other lizards, but still present in chams. A lot of reptile species have them to help them find good places to bask and regulate UV exposure. So even though your chameleon is sleeping with its eyes closed they are actually still registering the light source that comes from a night source, which disrupts their sleep cycle. For that reason you should not use anything that emits light (however dim) at night. They can tolerate temps down into the 50s so if it gets lower than that consider using a ceramic heat emitter or a space heater rather than a light.