Integrating intermittent renewable-energy supplies into existing electricity grids in a stable way will depend on artificial intelligence. Such a system could process massive volumes of consumption data and adjust power usage almost instantly, giving real-time control over supply and demand. Domestic consumers would be rewarded (with cheaper bills) for shifting their energy demand at short notice when the grid has a power imbalance, as is already the case for large industrial consumers and grid-scale storage systems. Smart meters that collect household consumption data would enable this process. By 2020, the United Kingdom aims to have such meters in 26 million homes and the European Union has a target of 200 million. These meters would contain microcontroller devices that communicate wirelessly with the grid. The meter could then momentarily dim lighting or switch off electric heaters, for example, without discomforting the occupiers. The efficiency of this process will depend on demand predictions for individual consumers, which involves using large amounts of data to model people's energy constraints and preferences over time. Embedded artificial intelligence will analyse and model these consumption data, enabling the grid response to occur within seconds.