i dont use it, but there are things like solar excess optimizer, maybe you can use something like this.
maybe relevant: load shedding