Integration Solar inverter huawei 2000L

Did anyone manage how to count selfusage/autoconsumption or whatever it is officialy called from data provided by this integrtion? I have power meter. On speed I think it should be current production substracted by export to grid, but I am not sure if this formula is perfect for any scenario.