Here I describe how a power isolator in Mindustry works, which you can use to protect your supply lines when you exceed your power generation.
This is used inside my Impact Reactor design to prevent failure during excessive power loads, and to ensure continued supply of titanium to the reactor.
https://youtu.be/XfQJFhHRZyE