This paper unveils the simulation and optimum design of five models based on photovoltaic (PV), diesel generator (DG), and battery energy systems for rural area farmhouse load demand (agriculture and household). The choice for designing an optimal energy system is constructed on minimum technical considerations like loss of load probability (LOLP), economic (cost of electricity [COE] with net present cost [NPC]), environmental (CO2 aspects) using a novel flamingo swarm intelligence algorithm (FSIA). The optimization results are compared by particle swarm intelligence algorithm, improved particle swarm intelligence algorithm, genetic algorithms, and hybrid optimization of multiple energy resources (HOMER‐Pro). FSIA shows PV/DG/battery energy system to be an optimal system as regards NPC (Rs. 8 056 734), COE (12.14 Rs./kWh), CO2 (13 784 kg/y), and LOLP (0.00000501 per year). The saving of the fuel cost and CO2 emission from PV/DG/battery to DG only system is 66.10% and 61.26%, respectively.