Negative power with calculation

Hello all,
I did a basic substraction with 2 CT to differentiate my heating consumption from my general consumption. Overall, it is working well but I have some issues with the instant power reading. It gives me negative values because I guess that there is a difference in time that makes the negative value
image
In order to do that I used this input:
image
Any ideas on how to adjust this

That is the reason for having “power1pluspower2” as an output from the “emon” part of the Pi.

If, instead of subtracting the two in emonCMS, you use the sum for “P-autres” but first you reverse one of the c.t’s (so that that power is already negative), then you are really doing the subtraction as you want. If then inside emonCMS you want to use the “wrong way around” power, you multiply it by -1 inside emonCMS to make it correct again.