I’m sure this shouldn’t be too difficult, but I’m trying to work out how to measure solar self consumption. I have a standard setup for the My Solar app:
So ct1 is the Grid import/export, and ct2 is the Solar (import).
Let’s say you do this on the CT2 Inputs processing. After what you have there now (use_kwh):
Reset to ZERO (start afresh)
+feed [ct1]
Allow negative (this “adds” only the {negative} export)
+feed [solar]
Log to feed [solar_self_consumption]
Power to kWh
I think that will give you the power and accumulated energy from the PV, plus the negative component (i.e minus the exported part) of the grid power/energy.
It’s recommended to use “+feed” rather than “+input” to better align the readings in time.