In this paper is presented an algorithm for the power management of a smart home with electric vehicle and photovoltaic panels. The case study is performed considering the power demand of the household appliances, the charging/discharging of the electric vehicle, and the power supplied by the photovoltaic panels. The photovoltaic panels have a small installed power and benefit from the support scheme from the government for these types of generation sources, so it is a prosumer. The simulation is performed for a day. Additionally, the cost of power supplied to the consumer is also analyzed.