Again, I'll note that using a step-down transformer to isolate the AC and bring it into the MCU's domain is another good option. Once there, a regular cheap comparator can be used. Or it could safely sent to an MCU ADC where the code can implement whatever limits it wants (because its isolated, it can be biased right to the ADCs mid-scale without necessarily needing a buffer amp, though it would need protection such as clamping diodes).
I initially concepted the circuit above for a DC application, hence no transformer. The only other advantage of the opto circuits discussed is that they're completely independent (or can be), which could be a benefit if it's gating a relay or something that's a safety concern.