Relay
Within switch assembly
Algorithm:1: Detect voltage2: Activate relay3: Read input again4: If power still there, declare ON, else OFF.