First, let's clear up the question. By "connected", do you mean connected to AC power through the switch? If yes, then an optocoupler can give you an AC-isolated square wave signal when the switch is closed, but it cannot tell you if the light has burned out. A light sensor such as a...