Last week, I attended BrumPropHack - a hackathon in Birmingham which looked at problems with retrofitting homes to make them more energy efficient.
There were some great talks about the scale of the problem - both in terms of the number of properties which need improving and the cost of retrofitting. A bunch of teams showed off some impressive demos which aimed to tackle the issues.
My demo was reasonably simple and (I thought) quite effective. It displayed a satellite view of a street in the local area. By clicking on rooftops, virtual solar panels are added to properties. Click a button and it shows your community how much CO2 they will save, and how much money they will make.
The demo worked (phew!) and received good feedback. For something built in a couple of hours, I'm pretty pleased with it. The way it works is...
- Draw an interactive map using Leaflet.
- Use ESRI's satellite images.
- The EU has a great and free API for calculating solar irradiance. So this sends a request for each panel giving its latitude and longitude.
- TODO! At the moment, it assumes all panels face south. A future version should let each icon be rotated to the correct degree.
- TODO! Each icon represents 4kWp of solar. A future version should let each panel size be defined individually.
- Use CORS Anywhere because making JS requests is hard now.
- Do maths to work out the total installed capacity.
- Do maths to calculate the CO2 value.
- TODO! This is calculated as 0.256 Kg/kWh. I found that figure on a website. Might not be accurate for the UK.
- Do maths to calculate the cost savings.
- TODO! It assumes 50% export at £0.25/kWh and 50% reduction in use at £0.50/kWh. That should be adjustable.
- Display a link encouraging people to sign up
- TODO! Make the link go somewhere.
- TODO! Display the cost to install - with suitable discounts for bulk buy.
- TODO! Draw some pretty graphs
- Uses Picnic CSS to make it look pretty.
It is a rough and ready demo, but it does work!
The code is freely available on GitHub if you want to build something more useful with it.