No battery current limit possible when DC-grid-feed-in active

Down the bottom of this thread, I posted my flow to export excess solar in the morning if the SOC is above 60%. The problem I have is the grid export limit per phase of 5000W. I have so much solar that the battery can be charged at 10 am and this is when the AC grid-tied PV inverters are also pumping out 5000w so I can’t export anything. Dumping the excess in the morning allows me to send 6-8 kWh to the grid before I hit my export limit.

There is some handy functions there to get power and do things at certain times of the day. You should be able to use some of it and either use MPPT power or current to set the - setpoint to reduce the battery charge.