Setup Helper - using 2 energy meters to calculate solar energy usage

Hello! Apologies if this is a bad way to ask this question.

I have a EcoFlow power station running part of our home. I am using a zwave plug that can monitor energy usage. Its been working great but limited by battery capacity/ full battery during the day not being able to burn it. To combat this I can set my ecoflow to power reserve mode and plug it into the wall, it will not pull wall power until its below 5%, it will blend solar power and wall power to compensate load if solar is available. this is perfect for cloudy days/running devices over night if the battery wont last till the sun comes out next day, but that power coming out will all be recorded as solar production.

I got a second z wave power plug to meter power being charged into the ecoflow when it dips below 5%, I am trying to setup a Helper to subtract power being used to charger the battery from the power coming out of the battery. So at night, if it is pulling 100watts from the wall, and 100 watts out of the battery, it will 0 its self as 0watts of solar production

This is what I have now and seems to be double counting, I am basing this off some other forums ive read but still lost. Here are my helper commands. Thank you all very much!

{{ states(‘sensor.solar_power_plug_electric_consumption_kwh’)|float - states(‘sensor.mini_plug_with_power_meter_electric_consumption_kwh’)|float }}

{{states(‘sensor.solar_power_plug_electric_consumption_w’)|float - states(‘sensor.mini_plug_with_power_meter_electric_consumption_w’)|float }}