Using Home Assistant to calculate my energy bill using data from my Solar Inverter

Alrighty guys,

Here is the fully manual solution I came up with using just the rest sensor for Enphase Envoy on D7 firmware.
It’s a lengthy guide with lots of explanation.
Hopefully it helps someone else out.