The Problem with EV charging is you'll pull more amps than the inverter will provide and it will trip. You probably ain't going to trip any 50A breakers no matter what you do with a 6KW inverter... Something simple like the box below. (Yea, I threw the mess together with a pallet, and some scrap wood, it still needs paint). I'm hooked to my secondary panel, with 24KW of inverter behind it, and I put this pedestal on a transfer switch, so it will feed it from the grid if the solar gives out. I overkilled and ran #4 wire out to the pedestal, but de-rated the breaker to 50A back at the solar/grid panel. The transfer switch means I don't have to play musical plugs/multiple EVSE if my solar goes to poopey. As a geek, I wrote software that monitors my battery SOC and I tell the EVSE to ramp up/down output based on it, but my solar is not dedicated. For a pure solar charge scenario, you only need enough battery to smooth your input to prevent a shutdown from overcast sky. I think basing your output on SOC still makes the best sense, just jack down output when your SOC drops, turn it all off when the batteries hit 10% or something. The API for evse has several options.
The API for the OpenEVSE WiFi module Powered by Stoplight.
openevse.stoplight.io
If time is not an issue and you have an adjustable charger, you could just set the inverter to turn on at say 50%, off at 10% and find a sweet spot 10-20A so it kicks on when the sun comes up, then maintains parity with your average solar output, kicking off after depleting the battery.
Have FUN!