A Smart Battery Management System for Photovoltaic Plants in Households Based on Raw Production Forecast