If you own the mining hardware, why would you do that? You are better off running that hardware 100% of the time (using batteries or similar when necessary). Mining hardware is expensive.
Only when you are actually better off. isn’t there a crossover point between the outside market needing/paying for electricity and mining? Or is mining the most effective return in all cases?