How can I create a sensor with 0 kwh

I’m trying to add multiple solar charge controllers going into my batteries on the energy dashboard,
If I add the solar to the solar section it adds on to the Consumption, I managed to work it out if I add them all together into one sensor. But I found if I could find a way to set up separate for each but they are showing unknown the value is 0 on the actual sensor but when I make an helper utility meter it just shows unknown. Any ideas?

maybe a template sensor with something like this?

{{ states('sensor.your_sensor') if states('sensor.your_sensor') != 'unknown' else 0 }}

thanks but the sensor still says unknown on the original sensor. I need it to say 0 not unknown it will not let me add it to the energy dashboard otherwise. It will never get a value as I never have a load on my charge controller but otherwise the energy dashboard is not tracking properly. Thanks anyway

i don’t believe you can change the original sensor. what i’m saying is that if you are doing a workaround by creating another sensor, you could use my template sensor to “wrap” the original sensor… and my new one will return 0 instead of unknown.

ok not sure i could use that in the energy dashboard. You would think it would show 0 instead of unknown on a utility meter if 0 kwh were actually used not unknown.

ah, i understand now. sorry… i don’t know that you can solve that without groveling into the integration code for the solor charger controllers… kinda doubt you can.

its on the actual HA Energy page I’m trying to add the sensor The actual charge controller sensor is showing correct at 0 kwh. When I try and create a helper Utility Meter the problem is showing unknown