Rytech
You might consider using the Allegro ACS712 in the battery leg of your system. It is a Hall Effect-Based Linear Current Sensor that is isolated from your current source. The fact that it is a bi-directional current sensor would allow you to monitor which direction the current is flowing; into the battery or out of the battery. On an A to D scale 2.5 VDC equals zero current and 2.5 to 5 VDC (well almost 5 VDC) is current in one direction and 0 to 2.5 VDC (almost) is current in the opposite direction. Even though I have not tried it, it is supposed to work in the AC leg of your project to monitor AC current flow. Even though it is a SOIC chip, it will handle 5 amps. There is another chip that handles over 20 amps.