Look up your inverter brand and pray there is an integration for it. Also: try to make your electrical meter smart to be able to tell the difference between pulling from grid and delivering to grid. If you already have a smart meter, see if it exposes some interface (like P1 with the DSMR protocol for example) to easily integrate the meter into home assistant.
I have done all this with a goodwe inverter and a kamstrup meter P1 port using a DSMR dongle.
If you need any pointers, dm me.
Have been customer with hetzner for more than 10 years and they are awesome. First physical server (HDD swaps in 10 minutes!) Now on their cloud environment. It just runs and is cost effective!
You can even use terraform to describe your resources and have them created automatically, or use the API from any programming language.