This
system from T-Max works as you describe.
It is not very fancy, in that you cannot tweak the set-points, etc. However, the default behavior is good. When there is no "input" voltage to either battery, the relay is open. When the vehicle is running, the relay is closed (starter side.) When my solar or shore-power charger is operating, the relay is closed (house battery side). When the relay would normally be open (no "charge" voltage on either side), I can manually close the relay with the push of a button.
The included relay was so-so, only lasted about 3 years, but I replaced it with a Cole-Hersee continuous duty 200A solenoid and it has worked great for the last 8-ish years.
EDIT: I should mention that I didn't use the battery wire included with my kit either (too small). At this point I'm only using the controller.