To avoid having to modify the circuit for each device being monitored, the circuit monitors the device’s AC power line directly. The resistor R1 lets a current of around 0.5 mA through the optocoupler LED. The other half of the current is rectified through the diode D1. It is obvious that the current to the optocoupler LED is half wave rectified. This means that the phototransistor part of the optocoupler receives only light impulses of around 100uA. The capacitor C1 filters out the current pulsation and maintains a smooth output current. In case the current pulsation is needed, just remove C1.