I had a similar idea except with a little twist. I like the idea of having a Transfer Switch but I want to use the energy that I've collected from solar panels and stored into batteries. I don't want to just sit there waiting for the grid to go down, because mostly, it's dependable and only goes ofline when there is a very terrible storm or a tornado. So I thought why not tap into the data coming from my battery monitor and pick a variable that I want to control on, Battery %, Amp Hours removed from 100%, Battery Voltage or Average Battery Voltage, then pick a turn-on point and a turn-off point to let the Automatic Transfer Switch run on the grid normally running on the Normally Closed contacts of a 30 Amp Double Pole Double Throw Relay. When my set point reaches the turn-on point, I have an Arduino Mega send an output to a small relay that completes the circuit to turn the inverter on. I have a 5 vdc wall wort plugged into one of the inverters outlets and when the inverter turns on, that wall wort sends that 5 vdc to another input pin on the Arduino Mega. When the Mega gets that signal, it sends another output pin high energizing another mini relay that completes the 120 vac 30 Amp relay coil. I've use this system for 5 years, running the deep freeze in the garage and the refrigerator in the kitchen. I can select the controlling variable, and the set-points. I usually only let it operate in a narrow window of operation so that the batteries are never under stress. So if/when the grid does go down, (and it has happened a few times in 5 years), I've got power to keep my stuff. The batteries should last forever.