Simple voltage presence monitoring with negative power supply
I found an app note AN467 from NXP that details how to drive TRIACs with a microcontroller, and it provides one solution: simply connecting the signal to a hot-side microcontroller's input pin through a high-value resistance, relying on the internal clamping diodes of the microcontroller for protection.



This solution requires a bit of hardware architecture reconfiguration -- implementing a hot-side microcontroller for presence detection instead of driving an optoisolator -- but it seems to be a more straight-forward way of controlling TRIACs and detecting mains presence than using oodles of optos.

Here is the simulation schematic in LTspice:


The L1 monitor output:


(See the next simulation output for l2_sw waveform.)  The DC value when the L1 switch is on reaches ~2.75 V -- enough to trigger a high state on a microcontroller's GPIO (else the 2 Meg input resistance can be lowered to increase this value).  When the L1 switch is off but the L2 switch is on we get an oscillating input that can be filtered out by software.  The capacitor C2 just smooths the ripple on the monitor signal when both L1 and L2 switches are on.

The L2 monitor output:


Monitoring the L2 switch is a bit easier since its signal oscillates symmetrically at mains frequency when on.  The DC signal present when the L1 switch is on but the L2 switch is off can also be filtered out by software.