The students prototyped a smart thermostat in 30 minutes

Share
The students prototyped a smart thermostat in 30 minutes
AI Generated Smart Thermostat app

During the first two weeks of July I had the pleasure of running a couple of mini hackathons with GCSE students in our Slough research centre and Manchester office.

I started with a 30 minute primer of the world of smart energy tech - everything from how the grid is evolving with distributed intermittent renewable generation, the growth and choice of smart tariffs to the role of home energy tech such as solar battery systems, air source heat pumps and electric cars.

I then set them a team challenge over lunch to come up with ideas for homeowners to get the most out of what I'd covered. Each team pitched their ideas in 3 minutes and we used a Raspberry Pi with a few daughter boards and code copilot to see if we could turn each idea into a prototype in 30 minutes.

Environment Dashboard

Environment Dashboard

To get started I'd already set up the Raspberry Pi with an Enviro+ daughter board so we were getting real temperature, humidity and other sensor values.

This screen and the integration to the board is entirely generated by the code copilot by chatting with it to fetch the values and display them.

We used github to store and manage the code making it simple to update the code on the Pi which makes it easier to maintain if we ever did anything else with it.

The Raspberry Pi had a 3.2" LCD attached so we could use the browser to view whatever we created although we also used Raspberry Pi Connect to remotely view it too.

During each team's pitch I wrote a summary paragraph on screen for copilot which we then read back as their summary and this is where it got really interesting to see what it created and the results surprised us.

Team A: A tool to reduce energy consumption whilst on holiday

This is the copilot prompt we composed:

I want a holiday mode so my home uses as little energy as possible from the date I leave to the date I return. I need a form for the start and end date. The hour of my flights. Let's use the Octopus Agile rates as a proxy for how green the grid is. When the Agile rate is low store energy in my home battery and when the grid needs more energy (Agile rate is high) export from the battery.

When setting up the Pi and prototyping the initial Enviro+ Dashboard I didn't give the copilot any guidance on the layout design, but the design is probably influenced by Tailwind. Copilot decided to use a card layout, chose all the colour scheme for us and the Agile daily green/amber/red style.

Once we'd created it we saw the flaw in the plan — the Agile rates are published at 4:00pm for the day ahead, so you can't get a forward schedule for your holiday period. Hence in this screenshot we've used a week in January to see some real data.

Notice too that the earlier Enviro+ Dashboard has a link to each page we created and there's a back to Dashboard link on each page created. Copilot decided to add this navigation each time without being asked to do it.

Holiday Mode Setup Agile Schedule Diagram

Team B: Control an Appliance

This is the copilot prompt we composed:

I'd like a page that is a tool for tracking my local weather data (e.g. open meteo) and to use this to control a few of my home appliances (dishwasher, washing machine, dryer). But it also needs to take account of my solar system so we use solar energy instead of grid energy even if there's strong wind. I'll need to provide solar data of some sort. And a switch to set this on or off. Give me a warning of extreme weather so I can do something different.

Once copilot gets underway you can watch it discussing with itself what it thinks you want and how it's going to create something. For example this is the analysis of that paragraph:

The user wants a weather-based home appliance control page that:

  • Tracks local weather data (e.g., from Open-Meteo API)
  • Controls home appliances: dishwasher, washing machine, dryer
  • Takes into account solar system data (use solar energy instead of grid even with strong wind)
  • Needs solar data input of some sort
  • A switch to enable/disable the automation
  • Extreme weather warnings

This is showing real weather data from the Open Meteo source and has made up some approximate kW figures for the appliances. With a bit more prompting we could have improved on this with a config per appliance.

Smart Appliance Control Weather Section Smart Appliance Control Appliance Section

Team C: Smart Battery

This is the copilot prompt we composed:

We're going to create another new page. Agile price - find the chepaest rate for the next day (import) and the best export (high) rate. Use this to charge a battery and to make the most money on export. Let the user check what the automated scheudle has created. Also have an override button in case the user decides they want to use the battery. Call it SmartBatt.

When copilot completes anything you get a written summary of what it's decided to do:

Here's what the SmartBatt page does:

Summary row (4 cards): cheapest import rate + time, best export rate + time, total charge cost, estimated profit (revenue minus charge cost)

Schedule table: next 48 hours of half-hour slots, colour-coded — green rows = charge, amber rows = discharge, grey = idle. Past slots are dimmed. Import and export rates shown per slot.

Schedule algorithm:

  • Picks the N cheapest import slots for charging (based on your "Charge Hours/Day" setting)
  • From the remaining slots, picks the N highest export slots for discharging
  • No slot is both charge and discharge

Settings: battery capacity, charge/discharge rate (kW), and hours per day — hit "Save & Recalculate" to regenerate the schedule.

Override panel: Force Charge / Discharge / Idle for 30 min, 1 hr, 2 hr, or rest of day — shows a warning banner while active with a Clear button. When the Pi has no internet the schedule will show "No rate data — check internet connection" but the override panel still works fully.

SmartBatt Interface SmartBatt Settings

It's impressive that without even asking for it, copilot has provided the settings boxes and options for the manual override. We could have written a more comprehensive description of everything in these screenshots but didn't need to. The downside of course is that we might not have wanted all that so the creativity might not always be desired.

We could have carried on and asked it to connect to the API of a particular manufacturer and so create a fully working system in less than an hour.

Team D: Smart Thermostat

And finally the Smart Thermostat. We were finding the black background hard to view so instructed a white version this time.

This is the copilot prompt we composed:

We're going to create a new page. Make it a white background. Provide temperature, light intensity and energy consumption averaged by day week and month. Notify when a target value temp is too low and to turn the heating on. Or an option to set it automatically by measured temp. When running as a smart theromstat also check the Agile rate and show the cost of using the heating. Call the page Smart Thermostat. Make sure it fits the screen we're using on the Pi.

And the written summary of what it's decided to do:

Here's what the SmartThermostat page does:

White background, compact layout sized for the Pi screen.

Current readings: live temperature (colour-coded cold/warm) and light intensity.

Red alert banner: appears in manual mode when temp drops below target, with a "Turn Heating On" button.

Averages grid: today / this week / this month averages for temperature, light, and total energy consumed (kWh).

Settings panel:

  • Target temp slider (10–30°C) with a "Use current temp" shortcut
  • Manual mode — you control heating on/off directly
  • Auto mode — heating toggled automatically when temp crosses the target
  • Heating power input (kW) for accurate cost calculations

Agile rate card: current p/kWh rate, cost per hour with heating on, estimated daily cost (8 hrs) — shows N/A gracefully when there's no internet.

History is recorded every 5 minutes to build up the averages over time.

SmartThermostat Interface SmartThermostat Settings

It would only have taken minutes to carry on and create a heating schedule. We discussed how we could use a relay such as from a Grove or Elegoo kit attached to the Pi for actuating a heating system.

Placing a hand over the temperature sensor we watched the live value increase and once the threshold was passed the Heating On changed to Heating Off proving we had a working smart thermostat.

I'm frequently contacted now by individuals and startups creating really interesting services using AI to create things very rapidly. As I said on the live webinars last winter this is where device and service APIs are powerful and I think we'll see a lot more home brew things. It could mean creating your own service (such as a smart thermostat) that's completely to your own taste and layout - why bother with settings for a colour scheme, font, card layout etc if you simply use a natural language chat to design something exactly the way you want it.