Resumen: Modernization of electricity networks is currently being carried out using the concept of the smart grid; hence, the active participation of end-user consumers and distributed generators will be allowed in order to increase system efficiency and renewable power accommodation. In this context, this paper proposes a comprehensive methodology to optimally control lead-acid batteries operating under dynamic pricing schemes in both independent and aggregated ways, taking into account the effects of the charge controller operation, the variable efficiency of the power converter, and the maximum capacity of the electricity network. A genetic algorithm is used to solve the optimization problem in which the daily net cost is minimized. The effectiveness and computational efficiency of the proposed methodology is illustrated using real data from the Spanish electricity market during 2014 and 2015 in order to evaluate the effects of forecasting error of energy prices, observing an important reduction in the estimated benefit as a result of both factors: 1) forecasting error and 2) power system limitations. Idioma: Inglés DOI: 10.1109/TSG.2016.2602268 Año: 2017 Publicado en: IEEE transactions on smart grid 8, 1 (2017), 316-330 ISSN: 1949-3053 Factor impacto JCR: 7.364 (2017) Categ. JCR: ENGINEERING, ELECTRICAL & ELECTRONIC rank: 10 / 260 = 0.038 (2017) - Q1 - T1 Factor impacto SCIMAGO: 2.854 - Computer Science (miscellaneous) (Q1)