How to control LED with 40mV AC?
If you can get some power off the AC side, you can make some DC and use a comparator to sense the 40mV and have it light an LED.  The LED would be the one in the optoisolator, and you can go across to the isolated side and have that trigger your flasher circuit.