Yup. I'm back.
I have been looking for a way to do this without a relay( using an opto- isolator with some transistors). My circuit comes with a battery charger, but I want to mosify it so that I use one relay instead of 2.
When mains is detected, Relay A (which I want to replace) will detect mains(its an AC SPDT relay) and then turn off the circuit so that the battery charger circuit(uses a trafo) will turn on, because relay A will power relay B. I want to use an opto isolator to make my design compact ( we all know the size of a relay TL;DR). Is there any way that I can make a circuit that would turn on an Opto isolator( without another trafo) so that when the opto turn on, it would shut down the transistors that power the other circuit? I was thinking of using high value resistors ( 1MILLIOHM)on the two ac lines, feed it to a zener diode to clamp the voltage so that it would power an opto and that's all. Is this a reasonable idea? Thanks for all your inputs, and oh, this circuit I am talking about is in a different board from this proposed circuit.