How to add a battery system with two energy inputs

Hello,
I’m trying to add a Bluetti battery to the Energy Dashboard.
I’ve integrated the Bluetti via Bluettoth and Bluetti2MQTT but I don’t know how to add to the dashboard the fact that the battery has two possible energy inputs: one from the grid and one from the solar panels.
I can only select one of the inputs in the Energy dashboard configuration

I’ve added the solar input so the result won’t be correct if I charge the battery from the grid for some minutes…

Have you found a way to correctly calculate this possible double input ?

Hi, you can sum up grid (ac input) and solar (dc_input) sensors into one sensor using helper entity “Combine the state of several sensors” using sum function. Then convert this power sensor (W) into energy sensor (Wh) using helper sensor “Integration - Riemann sum integration sensor” and use it in energy dashboard for energy going into the battery.

Good luck!