Enphase - Import data from Enlighten

Hi there,

I’ve got the Enphase Envoy integration set up and working well, but one thing it doesn’t show me is the amount of energy I have consumed/imported from the grid. I can see this data in the Enlighten app so I know it exists, but is there any way of pulling this in to HA?

Or is there a smart way I could calculate this? I was trying to work out if I could by adding up all the sample/polling times that my consumed - produced was < 0, but this seems overly complex.

Thanks!

Here is the configuration of 2 template sensors that calculate the energy you are currently exporting or importing based on the envoy integration: