EMHASS: An Energy Management for Home Assistant

You can setup the companion battery automation to stop exporting and put your solar inverter into zero export mode.

I also like giving visibility to EMHASS of the full PV potential even when curtailing production, so EMHASS can switch on other loads and further maximise my self consumption.