Hello Everyone, (my first post here ;-) )
I'm wondering, why don't you use
EVCC?
That stuff is pretty to look at and full-featured. It comes with vast Hardware-support. (PV-Inverters, Batteries, Wallboxes - of most manufacturers)
I just used that to pump up my Leaf 2. Gen from 20% to 80% today. (so you are seeing 23.7kWh total in purple, below)
(it automatically charges your Car up to 20% if it has less than that, so that the battery doesn't rest below 20%, thats why it started there this morning)
Here is Grafana showing the charging in purple:
Green is what the sun is giving me to work with.
Yellow is what the meter is seeing. (here in Germany, we get like 8 cent for a kWh, but we have to pay 4 times that... so make sure, that the yellow line is above 0! ;-)
Red is what the house is consuming...
Notice, that the charging speed is dynamically reduced, if needed, so that almost only solar power gets used. In total that was a >98% solar-charge in february. Cost: 2€ (about $2)
Best regards