I don't know of any existing products that do what you want, but it would be pretty easy for someone to rig up an automatic switch that would switch shore power on or off based on certain criteria.
Use a
Xantrex LinkPRO power meter to monitor battery state. It can be set to monitor either voltage and state of charge, triggering an alarm and a relay when the power gets below the set point.
If, for instance, you set the LinkPRO to turn on your shore power when the batteries were 30% discharged, as long as there was enough solar power coming in to keep the batteries charged, your shore power would be off. Once the SoC dipped below your set point, shore power would turn on, supplying power and charging your batteries. Additionally, you could set the voltage alarm fairly high ( 11.5V? ) so if you turned on a large drain, like using a microwave oven on the inverter, shore power would also kick on, even if SoC was high.
Use a few solid state relays to control the incoming power, like these -
High Performance Solid State Relays
No moving parts, handles 50A and can be triggered by anywhere from 3-36V, with triggering current low enough that the LinkPRO's relay output can handle two of them, one for each leg of the 50A plug.
You could add an override switch that would manually turn the power on as well.
The practical result is similar to what you wanted.
In my RV, when plugged in, the inverter/charger passes-through power to all of the interior outlets. When there is no shore power, the inverter makes power for all of them from the house batteries. The water heater and A/C are directly connected to the shore power.
If it were me ( and now that I thought this idea up, it might be... ) I'd wire it
so only the inverter/charger gets turned off. That way, the appliances that can't be solar in my RV ( water heater, A/C ) are never switched off, but in temperate weather all the little stuff can run off solar will, as long as there's an adequate battery charge.
The LinkPRO instructions are here if you want to see how to set it up-
http://xantrex.com/documents/Accesso...-01_rev-C).pdf
Check out section F2 for battery alarm specs.