Electricity production is the sum of the electricity production measurements of all generator outputs of a power plant. The overall electricity consumption of the power plant corresponds to the self-consumption and power losses of the power plant. Grid electricity is the energy that power plants provide to the system. Electricity purchased online is the electricity supplied by the system to the power plant, which can generally be deducted from the grid electricity.
Electricity production - integrated electricity consumption of the factory = grid power.