Yah, more info more power hahahhaa.
I don't know if it's possible, but if is, you could in the "first load" of the mod, run that upgrade script to scann all generator entity, and add up the max output power to some variable, than, i think you could add a listner to the on entity placed/removed to keep it update. And using the current value from the function to calculate the %. Same for the accumulators.
MaxOutput = 0.00;//updated from script and onplace/remove event
current_val = call the function "power_production or power_usage".
usedCapacity = (current_val * 100.00) / MaxOutput;
Than we could have a signal "Max power output" reading from MaxOutPut and "Current % Usage" reading from usedCapacity
The accumulator seems to do the % value already but it doesn't tell the Total Capacity that you have.
So i think if we approach both the same way we can have all values.
But I don't know how we would calculate the needed power, since with those values we would have that we are using 100% of 100%. The game knows, some how, how much you need to update the energy bars that goes red.
Only if "power_production, power_usage" have different values that would make things way easier. dunno why they put 2 functions that will always return the same value.