I was wondering if that would work, I thought that might cause issues with the batteries still getting slowly drained over time due to some current getting pulled from them as well though.
What about a single pole double throw relay? Do those touch one terminal when there is no power on the coil and the other terminal when there is power? Or is it a stage latching type thing where power is dropped from the coil and then applied again to change the state of it?
If it's the first it might work as well. Just put power to the coil from the wall power, and to one of the terminals, and power from the battery on the other terminal, with the common going out to a capacitor to handle the slight delay in switching. The downside to that is if it rapidly switches back and forth for some reason it could still cause a power interruption, although I guess that could be solved with another capacitor in front of the coil wire from the wall power.
This is also assuming I can share a common ground between the batteries and the wall terminal, I don't know if I can or not?
Sorry if some of this sounds idiotic lol, I still have quite a bit of learning to do about circuits :)