Text this: Stochastic control with state constraints via the Fokker–Planck equation. Application to renewable energy plants with batteries