Battery systems gain popularity among users in residential household setups. In this setup, currently the main source of profitability is to increase photovoltaic (PV) selfsufficiency which is highly dependent on the battery system efficiency. We present a control approach based on stochastic dynamic programming (SDP) suitable to increase the system efficiency. The optimization framework includes a switched system with standby losses, a nonlinear modeling of the converter losses as well as a stochastic forecast model for household load and PV generation. We show in a simulation of a typical benchmark case that our approach can in fact reduce overall system losses and costs of operation. Then, the applicability in a real-world scenario is shown using a commercially available battery system in a field test.