Solar Export helper

I make solar export helper template. So my solar production W - home electricity W = solar export (W)
If is Solar high and home low in have export value. If is solar low and home high i have NEGATIVE export value and my graph is duble in home electricity. So how i can adjust yaml if is solar low and home high = 0W export.

{{ (states(‘sensor.solaredge_i1_ac_power’)|float - states(‘sensor.trenutna_watt’)|float )|round(0) }}

I may not have this exactly correct, but try something like the following:

{% set export= (states(‘sensor.solaredge_i1_ac_power’)|float - states(‘sensor.trenutna_watt’)|float )|round(0) %}
{% if export < 0 -%}
  {{ float (0) | round(0) }} 
{%- else -%}
  {{ export }}
{%- endif %}