I can see a way for you to do it. It’s very convoluted, and sorta unique to your circumstance. First let me reframe and expand on the problem slightly…
What’s at issue is adding up all of the positive power from the inverter, discarding the negative power going to the inverter. Because IoTaWatt accumulates net power, any attempt to do this at greater than 5 second grouping would begin to introduce error. The output
Inverter1Output = ( InverterB1 max 0 ) * 2
will add up all of the positive groups of InverterB1 .(The binary operator “max” selects the greater of it’s two operands, so when the value is negative, it yields zero).
If you plot this output in Graph+ to an hour’s worth of data, the grouping will be 5 seconds, so it will give you a good result. But if you run it over a day, the grouping will be 2 minutes, so the output script is applied to 2 minute net values. Where the 5 second values in a group are all positive or all negative, the result will be correct for that group. Where they are mixed, it will be incorrect because the script only operated on the net value.
That might not be a problem in this case, because my sense is that the overwhelming amount of negative values would be at night and the positives during the day. There may be some mixup during startup and shutdown, but that would be insignificant.
The problem starts to grow as you zoom out to a week or month and the groups become larger. You need an approach that integrates over the individual samples. IoTaWatt doesn’t do that, it would be too resource intensive.
So now the convoluted solution. For some degree of simplicity I’m going to only show this for one inverter.
You currently have two CTs on the inverter, one on each of the wires, but this is a two wire appliance so only one is needed. That is key to this solution. So lets reconfigure the two CTs as:
Inverter1_net where you check “double” and “allow negative values”
Inverter1_abs where you check “double” and NOT “allow negative values”
This essentially performs the data segregation as each sample is taken.
Let’s restate those two inputs in terms of Pout, the power generated, and Pin, the power consumed.
Inverter1_net = Pout - Pin
Inverter1_abs = Pout + Pin
Now if you add the two together you get 2Pout. Dividing by 2 you get Pout, So defining an output:
Inverter1_out = (Inverter1_net + Inverter1_abs) / 2
Should give you what you are looking for, the positive output of the inverter… And it follows that an output:
Inverter1_in = ( Inverter1_net - Inverter1_abs ) / 2
Will give you the amount of power the inverter consumes as a negative value.