When my external display is on, my Mac thinks it's off. When it's off, on
Restart you Mac and try resetting the PRAM:

Hold down the &#x2318;+&#x2325;+R+P keys until you hear the start up chime two times.