Calculate energy that is not consumed

Hello, using the sensor given below, I calculate the excess energy that is not consumed. All 3 phases are added. However, I only need the values that are below 0. How do I put that there? And this value should then also be shown positively.

  - name: "Energy ins Netz"
    unique_id: energy_ins_Netz
    device_class: energy
    state_class: total
    unit_of_measurement: "kWh"
    state: >
     {{ 
     states('sensor.shelly_shellyplus1pm_4417939a4214_total_consumption')| float(0) +
     states('sensor.shelly_shem_3_244cab41a5bd_1_total_consumption')| float(0) -
     states('sensor.shelly_shem_3_244cab41a5bd_2_total_consumption')| float(0) -
     states('sensor.shelly_shem_3_244cab41a5bd_3_total_consumption')| float(0) 
     }}