Create a virtual electric consumtion to show self-consumption

I have the following situation:
I have two Discovergy smart meters, a PV system with its own meter (PV production) and a house with its own meter that measures the total consumption.
A virtual meter from Discovergy that shows the difference between the two and displays the excess PV production as negative consumption.
All meters are bi-directional meters, but are currently only used as one-way meters.

I have the following counters:

  1. PV production (positive values)
  2. house consumption (positive values)
  3. virtual meter (positive and negative values for consumption), no data for production or feed-in

To get an overview of how high my actual self-consumption would be, I would now like to calculate my self-consumption and feed-in in the “Energy” dashboard.
Unfortunately, this does not work as expected, as with the normal method, the self-consumption is always displayed as 100% and no feed-in is shown.
How can I summarise or calculate these meters so that I get the desired result?

Virtual meter

Production meter

Consumption meter