Hackathons, the whirlwind competitions that challenge developers to solve complex problems in a short period, are like the Olympics for computer programmers. Teams compete for prizes, professional accolades and bragging rights among their peers. But one week last fall, they set their sights on a loftier goal: saving Mother Earth.

The 100 competitors at the first Appathon, held during GE’s Minds + Machines conference in San Francisco, had just 30 hours to conceive and develop a working app for the Industrial Internet of Things (IIoT). “We were forced to make sure we had something of value in a very short period of time,” says competitor Christian Berg, a senior program manager at Microsoft. “We had to be laser-focused.”

Berg and his four Microsoft teammates, Mike Zawacki, Maarten van de Bospoort, Jenna Goodward and Shirley Wang (who came all the way from China) brought their A game. The team won its division with a “bring your own device” app, named BYODevice Demand Response, that could maximize renewable energy consumption by suggesting the best time to use electric devices based on demand on the grid and renewable energy output.

The BYOD app takes advantage of the increasing number of IoT devices. If the BYOD app comes to market, users could download it to any of the growing number of IoT devices, including electric cars, printers, dishwashers, mobile phones, thermostats, washers, smart refrigerators, lamps and laptops. The more devices are connected, in theory, the better informed the app will be.

The Microsoft team’s app would mine data collected using Predix to determine the optimal time to charge, consume power or discharge power, making the devices “smart” energy users. The app would consider the current demand on the grid and what percentage of the power is being generated by renewables at a given time, among other factors. “The app will send a signal to the devices all around us alerting them to the best time to use electricity,” says Microsoft’s Jenna Goodward, senior program manager for renewable energy. A laptop with the app, for example, might be plugged in at 10 p.m. but won’t start charging until 3 a.m., while a thermostat would be alerted throughout the day to cool buildings when the electricity being generated is as close to 100 percent renewable as possible. Renewable energy sources can vary as wind speeds change or when the sun sets.

The team started with a lightning round of brainstorming that yielded two potential ideas. The BYOD app stood out because it could be easily scalable — dozens or millions of people could use it.

The app takes into account a number of factors — when renewables make up the most energy supplied to the grid, the price of energy on the commodity market, and consumption history, for example — to predict when the energy supply is cleanest and most cost-effective for powering the app-enabled device.

“It’s an opportunity to make demand match supply,” says Zawacki, a senior developer at Microsoft.

A large number of devices using the BYOD app could also make power companies less susceptible to big swings in demand. Now, for example, electricity use surges on hot summer days around 6 p.m., when people arrive home from work and crank up the air conditioner. The BYOD app could alert ACs to keep the house a little warmer and reduce the spike in consumption. That would make the grid more efficient and cheaper to operate.

The app would also allow energy producers to create what-if scenarios to find ways to smooth out surges in demand on the grid. For example, dishwashers and clothes dryers connected to the app might be told to delay running right before rush hour, leaving more power available for electric vehicles to top up for the ride home. Or the data collected using Predix apps may indicate a temporary drop in electricity costs on a sunny day, so laptops and space heaters might be alerted to charge immediately.