The generator is connected to your electrical system with an automatic transfer switch. When the power goes out, the switch detects the outage and signals the diesel generator to start. The switch then disconnects you from the grid and connects to the generator.