Battery in energy dashboard flipped

I’m having trouble to configure my battery setup. I’ve set the entities accordingly in the configuration, but the ‘charge kwh’ is displayed as ‘delivered back’ . This is incorrect. I either want to remove this, but I have to configure both entities.
Even more weird is that the solar output is not visible while I was charging the batteries; which is incorrect as wel.

I’ve set two entities:
ChargeEnergyTotal represents the kwh it charged from the grid
DischargeEnergyTotal represents the kwh it delivered back to the grid

How can I display it correctly? The red bar should not be negative, but displayed as consumption.