You can also use dev tools / templates to find out what the source sensors values are and also experiment with different calculations.
See this screenshot for example
Here is the example code to paste into the template editor
Power Production {{ states('sensor.power_production') }} W
Power Consumption {{ states('sensor.power_consumption') }} W
Power Export {{ [ 0,
states('sensor.power_production') | int(0) -
states('sensor.power_consumption') | int(0)
] | max }} W
Power Export {{ [ 0,
states('sensor.power_production') | int(0) -
states('sensor.power_consumption') | int(0)
] | max / 1000 }} kW
Power Import {{ [ 0,
states('sensor.power_consumption') | int(0) -
states('sensor.power_production') | int(0)
] | max }} W
Power Import {{ [ 0,
states('sensor.power_consumption') | int(0) -
states('sensor.power_production') | int(0)
] | max / 1000 }} kW
This code above assumes that your envoy is providing sensor values in Watts.
If you are like @mathieuruellan who claims that the envoy-S provides values in kW, then your template code will have to be like this instead.
Power Production {{ states('sensor.power_production') }} kW
Power Consumption {{ states('sensor.power_consumption') }} kW
Power Export {{ [ 0.0,
states('sensor.power_production') | float(0) -
states('sensor.power_consumption') | float(0)
] | max }} kW
Power Export {{ [ 0.0,
states('sensor.power_production') | float(0) -
states('sensor.power_consumption') | float(0)
] | max * 1000 }} W
Power Import {{ [ 0.0,
states('sensor.power_consumption') | float(0) -
states('sensor.power_production') | float(0)
] | max }} kW
Power Import {{ [ 0.0,
states('sensor.power_consumption') | float(0) -
states('sensor.power_production') | float(0)
] | max * 1000 }} W