Abstract: The invention is directed to an electronic control apparatus which will shut off a heating or airconditioning system when a door or window is opened. The apparatus provides a magnetic switch and transmitter attached to a door or window which will emit an infrared or sonic signal when the door or window is opened. The signal is received by an infrared or sonic receiving means which shuts off the thermostat from operating for at least three minutes to prevent damage to the heating or cooling system, in particular the compressor.