Option to invert statistics parameters in Energy Dashboard

I noticed that the Energy Dashboard interprets my Grid statistics the other way around, so to fix it I created an inverted Grid sensor (original * -1) an this “fixed” the Energy Dashboard but I am now missing years of historical data I previously and preciously stored.
A toggle/checkbox option to simply invert the input data would fix this issue entirely.

The Power Flow Card does this brilliantly easily.

1 Like

I had the exact same thought when i stumbled across this issue yesterday. Has anyone figured out a workaround?

Someone told me I could duplicate the historical data and invert it directly in the database but despite being easy in principle I’d be very scared to try this myself…
I’ll have to wait and hope that someone more influential than me has this same issue too

Use this search…

https://community.home-assistant.io/search?q=energy%20history%20invert%20%40tom_l%20order%3Alatest

Can you please share how you created the inverter grid sensor.

Thanks, I’ll keep an eye on it but for the moment nothing relevant comes up.

Hey, shady7, simple enough.
Create a template sensor and multiply the current sensor by -1.
Remember to define state_class as ‘measurement’ (a device_class if you want) and importantly a unit_of_measurement otherwise it won’t be picked up by the statistics.