Shelly em and energy dashboard

i have installed and integrated the shelly em with two 50A clamps one mesures one my house energy consumption and my solar production
if i want to mesure the energy selles and the energy bought from the grid i have to do a simple subraction or am i missing something?
if so how do i create this sensor?