fix ratio functions when values are zero
In some cases generated_energy, energy_production and energy_consumption can be zero, so fix zero div can occur.
We opt for return zero if some errors happen during calculations and notify them to track what were the problems.
This MR fix that situation