This paper proposes a prediction model based on fuzzy logic applied to anticipate electricity production and consumption in a building equipped with photovoltaics and connected to the grid. The goal is a smart energy management system able to make decisions and to adapt the consumption to the actual context and to the future electricity levels. The interest is to use as much electricity as possible from own production. The surplus is captured by an energy storage system or is sent to the grid. When no electricity is available from self-production, the grid is used to cover the necessities. The evaluations are performed on a data set collected in a real household. The proposed method is compared in terms of mean absolute error with other existing methods. The method developed based on fuzzy logic has an error of about 67 W, which places it among the most efficient models.