The energy consumed in a three-phase circuit can be determined from the active power values over time. If the active power is constant during the observation period, the energy is simply the product of power and time. However, if the active power varies, the energy is obtained by summing the contributions of power at each time step multiplied by the sampling interval. This method ensures accurate estimation of energy consumption for both steady and time-varying load conditions.
I propose using a three-phase meter component and then an integrator at its output. The output of the integrator would be the total energy in Ws, so then you can just scale it to kWh.