Car charging speed regulating, max 10kw

Hi,

I am trying to create a flow to keep me under 10kw for the house. I have 230v 3 phase charger that can supply 28A to the car, 11kw. So based on other things that draw from the house, the charger should dynamicly reduce the power to the car.

I think I have most of the flow, but missing a logic that can set output to be dynamic, but max 25A.
I am using both tesla charger and the new tesla API.

How do i add the dynamic calculation from wattage to ampere to max speed based on 10kw roof?