Hi,
the idea sounds simple.. but the real circuit is a bit tricky.
The problem is: the battery voltage will go down a bit immediately when you connect a load.. and it will continue to go down the longer the load is connected.
And the same other way round.
Example: (All values are just example values)
Let´s say the voltage of battery1 is 12.8V when no load is connected.
As soon as you connect a load the voltage drops to 12.5V.
After the first hour the voltage slowly drops linearily to 11.5V
But after only 5 Minutes later it is at 10.5V. The battery is empty.
At this point you need to disconnect the load to protect the battery from under discharge.
Now the load is disconncected and the battery voltage may rise to 11.5V within one minute. (without charging)
The same happens to the second battery.
--> The key problem is that you can´t rely on the battery voltage, because it depends on: charge state, time, health status, temperature, time, load current or charging current....
Now it´s your turn to consider how your battery switch should operate.
From your post I see you already had the bad experience of switching back and forth. You need to avoid this.
But how? Either read through existing documentation how others solved this problem... or create your own rules.
* maybe: at 13.5 Volts the battery is considered (and marked) as full and is considered full until it reaches 10.5V. ... from this point it is considered as empty until it reaches 13.5V.
This is called "hysteresis". The area between 10.5V and 13.5V is a grey area. It may be "full" or "empty" state depending on the voltage level before.
There are several ways...
Maybe the best - but maybe also with the highest effort - is to use a coulomb counter to get true charge sate information.
Klaus