Accurately working out ROI with solar + battery (with Enphase Envoy data feed)?

I have been trying to understand how pvoutput calculates your current ROI position in the mouseover - the figures don’t look right to me but I don’t know enough yet to figure out how to change this (or if it can be changed).

I’m currently generating power from PV and a chunk of that goes into charging the battery. I’m using two feeds from our Envoy - one as ‘Solar’ and the other as ‘Consumption’.

I’m assuming what happens is that pvoutput assumes that consumption all comes from the grid rather than partially from the grid ?

As such it seems to do a calculation that is X is generated, Y is exported and Z is consumed. X is larger than Z but Z is larger than Y.

As the feed in tariff here is $0.11 and the consumption tariff is $0.24 it shows a net loss. However a large chunk of that energy being consumed (almost all of it) is not in fact imported.

What am I missing or how should this be reconfigured to more accurately reflect that ?

It is based on actual export and import reported.

Enphase batteries discharge values are reported in consumption: