Here's what I was originally thinking of trying. Using a standard Grid tie inverter. It is my understanding as they are originally designed, it would go on my side of the meter. The solar is run into the grid tie inverter and I would use the power I made plus any needed from the utility side. If I made more than I used, it back fed it out to the grid through the meter. Where I live they do NOT do "net metering", meter reads both ways. They do Bi-metering, they want me to install a meter on my Array, do a grid tie, feed it to the grid, then pay me $0.0375 per watt/hour, and buy it back at $0.1075 a watt/hour through my other meter.
What I was thinking of trying, install just like I was going to be doing "Net metering" but install a Rack of PLCs to monitor and control some functions. I was going to put a Current Transformer and Potential Transformer on the incoming utility line to monitor the wattage/voltage. Then have the Arrays wired with DPDT relays on the string wires with the PLC rack controlling them. Programming would be the rack would see if the incoming utility wattage dropped to lets say 500W-1000W, that would mean I'm approaching the point I would be making more power than I'm consuming and it would be getting ready to export power through the meter. The PLC would see this and start switching relays. diverting solar power to the charge controllers to charge a bank of batteries. This would drop the output of the grid tie inverter to keep me from exporting power to the grid.
Then the idea I'm toying with, is at night have an Automatic Transfer Switch, switch from Source 1 to source 2 by having a small pure sine wave inverter simulate AC power at the S2 on the ATS and at the same time have a relay switch the Battery Voltage to the String Inverter and let the String Inverter power the building from the battery bank instead of the Solar Array. I'd have the rack of PLCs monitor the voltage and such, that way when I reached a predetermined Low Battery Voltage level, it would switch the ATS back to utility power.