Hundreds of homes and businesses in Cornwall have started selling electricity to their local energy network and the national energy system in a pioneering move.

The trial is the first time that traditional energy users – such as homes, hotels and businesses – have acted as suppliers in a microcosm of a full energy system.

The trial harnessed together 100 Cornish homes, fitted with batteries and solar panels, to act as a mini virtual power plant for the local energy network, Western Power Distribution, and the UK’s energy system operator, National Grid. During sunny spells when homes generate more than enough electricity from solar panels they can store the power to use later, or supply the energy system with clean extra power.

The homes took part in the trial alongside 150 local businesses, which were prepared to adjust how much energy they used depending on the balance of energy supply and demand on the grid. If wind and solar power output dropped the companies could choose to use less electricity in exchange for a payment from National Grid, or if the local grid had more electricity than it needed the companies could ramp up their energy demand.

National Grid already offers to pay firms that own utility-scale batteries to provide a similar service, but the trial is the first time that companies can take part in the same “local energy market” as the network operator. The market was designed by energy giant Centrica and modelled on the same system used to balance energy markets across Europe. The energy companies believe the trial could help create a nationwide chain of flexible smart grids built around clean energy.

Pieter-Jan Mermans, a director at Centrica Business Solutions, described the trial as “a milestone moment for the energy network” after years of research.

“Improving grid flexibility benefits everyone from generators to consumers, and these trials represent a major step forward. We are hugely grateful to the householders and businesses across Cornwall who have embraced this trial with open arms,” he said.

Sign up to the daily Business Today email or follow Guardian Business on Twitter at @BusinessDesk

One local business, The Cornish Ice Company, is using its industrial freezers to act as a battery for the grid. The company can easily cut electricity to its freezers for short periods without affecting temperatures, meaning it can offer spare electricity to either the local grid or the national system operator.

“Exploring the provision of flexibility through a local energy market is a first for us.” Colm Murphy, a senior manager at National Grid, said.

“The potential is really exciting as we look to unlock more flexible energy resources in the market, and greater cost benefits to consumers,” he added.