EV car, wall box, tesla powerwall - instant energy consumption

Hello everyone!

I am seeking a solution and would like to ask for your help…
I have a contract with my energy provider that allows me to consume 6 kWh instantaneously and sometimes when I have my car charging and -for instance-, I turn on the oven, the consumption goes over that value and I get disconnected after a few seconds and I have to wait 15 minutes to get power back!
I would like to make an automation (or an integration!) that every second checks if the current is above, for example, 5.5 kWh, and reduce the amps of the wall box in way to have a constant consumption of max 5.8 or so… That has only to be applied when the batteries of my house are below 20%.
Any ideas?
Unfortunately, my wall box should already be capable of doing that but is not working because I have three phases and so it is not reading the correct consumption of the house!

I hope I could explain it well…
Thanks

Any ideas? Thanks