I have solved this another way. Now I get the number of pulses (led blinks) from my energy meter to a mqtt sensor in HA. Then add these pulses to ( 1 pulse is 1 Wh so I divide by 1000 to change unit to kWh) utility meter and use that as energy management source.
So I think this problem is solved. I thank everyone who answered to this topic. Each answer took me further on solving the problem.