eddie
LIFE MEMBER
It was a DIY question!This is the correct DIY method, but a proper inverter-charger does it better. I'll give Victron as an example but all decent brands should do this:
The 500 Multi series will detect if the incoming mains is within the correct safe range before it gets used - so too low or too high and it stops using it.
The 800 and upwards Multi series support Boost and Fade, which means it will re-process mains that is a bit too low or high into the correct voltage so it works exactly as a high-end computer UPS delivering clean power within spec regardless of what goes in!
(The 800 and upwards can also be paralleled for more power with a synchronising bus cable as an aside).
So a relay is fine, but a proper product is always better for the reasons stated above!