Thanks for the suggestions!
Connecting solar to the grid is harder than you think isn't it?
Here's a link to the full schematic and code of the updated version:
https://akiotv.nl/warehouse_data/GTI_updated.zip
(AKIO TV) MMXXIV
https://instagram.com/actual_akiotv