Energy Template: Create new energy measurement entity that counts only negative power -> kWh

I have a power entity that gives me the actual power usage of my house in Watt (W). I created a new entity that counts the used energy (kWh - Riemann sum integration). I have a solar panel and at some point the energy usage of my house is less than the created energy of my solar panel, so the power is negative. Is there a chance to create a new template (like the riemann sum) that only counts negative power → energy (kWh) back to grid?

1 Like

Yepp!

2 Likes