Thanks @del13r , I read your guide. But, unfortunately, due to the D7.* firmware, I have to use the Enphase Envoy (DEV) integration from this forum thread. And the “today_s_energy” always 0.
I then convert the sensor.envoy_XXXX_current_power_production to kWh using Riemann Sum helper GUI. And I use this for the Energy Dashboard. It looks it works, at least it has the same value compared to the Enphase Enlighten mobile app (slightly different because Enphase app only has 1 decimal). I hope this is the correct way to get the solar production.
And for the Grid Import and Export, I use the reading from P1 meter connected to the smart meter. I think, this is the way if we have smart meter with P1 port. The reading should have been calculated with the solar panel production. Again, this is my understanding.
Gosh! What a very confusing to setup. I setup Home Assistant mainly for this Energy Dashboard, but it turned out super difficult, with non-working integration, limited documentation. I should not complain, I know. The devs have done very good job, but one of “core” functionality of HA is for this energy monitoring/management, and it is bad. /rant