If you mine less than what you could have sold your free power for, you should not mine.
I hear about people having solar panels (paid off), so now they can mine all they want because power is free.
If you just sold the energy, you would most likely get more money than if you mined with it.