How to deduct EV charge KwH from overall?

Hi all, HASS user here that has just installed Grafana to solve some limitations i have with the HASS dashboards.

What i am trying to achieve is a chart of energy usage against external temp to see how hard my heat pump is working but i want to exclude EV charging from the overall usage.

The attached should show the temp as a line and then the off peak and peak energy usage as lines aswell as the EV charging in the off peak period.

Im stuck on trying to merge the off peak and peak energy minus the energy used for EV into one line to graph against the temp.

Have you tried using a simple Transformation like this whereby you can add or subtract the desired fields? You can also use the result of the first transformation in a second transformation.
image

hi, thanks, i can see how to add items together on this but how do you subtract?

thank you, will try that!

so it gives me NAN for the periods where there is no ev charging therefore leaving the line incomplete, sorry im sure im doing something idiotic!

You should be able to apply a filter that excludes the NaN. Perhaps a Transformation like this?
image