Your situation is no different to that of anyone with solar and a battery.
The general energy equation for solar and batteries is
Solar + Import + Discharge = Load + Export + Charge
in that energy is immutable, and the sum of generators must equal the sum of consumers.
Home Assistant energy dashboard works very nicely, as long as you use all the relevant sensors correctly. Solar, Grid Import, Grid Export, Battery Charge, Battery Discharge.
This just leaves the ‘house’ load which is calculated as Solar + Import + Discharge - Export - Charge
Solar can only be used, going to load, battery, or grid export
If you generate 24.3 kWh solar in a day, then the HA Energy Dashboard will assume it all goes to the load unless you add the export sensor and the battery charge sensor to show that it goes somewhere else.
If, as you say, you charge your battery from the grid, then this grid-import value is required in the equation to make it balance. If, as you say, you export all your solar, then this grid-export value is required in the equation to make it balance.
Solar 24.3
Discharge 5.57
Import 1.78
total generators 31.65
This generated energy has to go somewhere. You only have 0 kwh to the battery (no charge) and 0 kwh to the grid (no export) hence the equation says
Load = 31.7 since you are not, apparently charging your battery or exporting to grid.
I don’t know what your house load actually is, but assume 10 kWh
Solar 24.3 (from generated solar PV sensor)
Discharge 10.0 (from battery discharge sensor) - supports the load
Import 10.0 (from grid import sensor) - to charge the battery
total 44.3
Load: 10
Export 24.3 - (from grid export sensor) effectively all solar
Charge 10 - (from battery charge sensor) effectively from grid
total 44.3
Then it balances. You just also need to add a ‘return to the grid’ sensor that correctly shows the true grid export, and a battery charge sensor that correctly shows the battery charge.
Solar: 5.56
Import: 0.24
Discharge: 3.80
total 9.6
Export: 0.13
Charge: 4.0
Load: 5.47
total 9.6