https://www.gov.uk/government/consultations/smart-metering-equipment-technical-specifications-second-version Page 87 "Consumption shall be the sum of the cumulative Active Energy Imported on  the importing measuring element(s) of its Electricity Meter less the sum of the  cumulative Active Energy Exported on the exporting measuring element(s) of  its Electricity Meter;"   I.e. you just add up all the import ever and subtract all the export ever to calculate total consum