Since the inverters AC output is connected directly to the incoming grid AC mains, and to the house power consuming items via the switchboard..... We can say the inverter output voltage will always be equal the incoming grid line voltage and the invertor output phase cannot be measurably different from the line phase (there might be very small voltage variations because of wire resistance, but it will be minimal; under a few hundred millivots at worst I'd suggest).
This is a great project that might help you understand how to measure power direction based on a comparison of voltage and current polarities in a single line.
Since the Inverter only ever produce power, the current flow from this device is always in the same direction. The same applies to the house side, it's always consuming energy so the current flow is always in one direction.
But with a Current Transformer (CT) on the grid incoming mains you can readily measure the direction and magnitude of current flow using the project above. It's open source so you could choose to build or buy.
Most utilities change the Power Meter when there are large PV arrays on site. The bi-directional meter measures the direction of current flow so the meter consumption numbers can be negative (supplied power to grid).
There are chips such as this that do the work for bi-directional meters but they are complex beasts looking at high resolution voltage and current polarity relationships on a single grid line.