I use Home Assistant and have both the official bundled Tesla integration and the custom HACS integration installed. I use the bundled integration to manage my Powerwalls and the other for my vehicles.
My workflow for the automation, simplified, is something like this: IF Powerwall charging status goes from on to off WHEN the Powerwall SOC > 99% AND the time of day < 15:00:00, start a script which starts charging whichever vehicle is plugged in, calculates excess/backfeed solar, and adjusts charging amperage on the vehicle to match that excess. It re-evaluates every 5 minutes or until either the car is finished charging or the time is 15:00:00, when it will stop charging my vehicle. If the vehicle finishes charging prior to 15:00:00, I get a push notification alerting me that I'm backfeeding off-peak, which means I can plug the other vehicle in, or run whatever energy hungry thing I would like to run at that time.
Hope this makes sense.