Tracking Electricity Consumption data with a ChatGPT AI assistant
Beyond the hype….
I have been exploring the use of ChatGPT across topics ranging from understanding legal text, drafting contracts — both traditional and smart ones, and generally refreshing my software coding knowledge. Since yesterday evening, however, I have used it to create something real and meaningful for me. What prompted this was a surprise bill from Octopus Energy — the bill said I owned them an abnormal amount of money in one month’s electricity consumption. Of course, they provide an in home display and access to MyAccount; however, they aren’t necessarily designed to alert me if my daily consumption exceeds a certain threshold.
So, I asked ChatGPT to help me code an application. Now, some disclaimer — my software coding skills have been rusty. I don’t code on a daily basis as my job is more managerial; but I know the fundamentals of the programming languages. So I took a plunge to use ChatGPT to help me.
The end result is an app that
- Tells me about my energy consumption during the day and prompts me whether I have cross my budget threshold during the day (though for reasons shared below, it doesn’t get the data to do so on a real time basis) (figure 1)
- Tells me about my current (ie last half hourly) energy consumption (figure 2)
- Creates a plot of all half hourly energy consumption (figure 3)
In the process, I managed to learn with a hand on approach not only a bit more about python, javascript, git and Flask; but also about how Octopus’ APIs are written and how to use them. I also learnt that although Octopus’ API allow us to get information about our energy consumption; it is not real time — the available information lags by almost 24 hours. So, creating an application to support real time use cases is not immediately available
So, you may wonder this is great but why is this experience relevant to those who don’t code but manage software development teams and programmes. The simple reason is that it allows anyone with an idea to translate the idea into a working software. Doing so makes it easier to communicate the potential of the idea with a working software and iteratively refine it by engaging the experts — be it UX developers, software engineers, business analysts, or sponsors. I am on the opinion that ChatGPT has quite a lot of relevance for anyone who wants to design a new product.
Your thoughts and opinions are welcome. I share below some reference on how I progressed.
References:
- My initial prompt to ChatGPT was
Octopus Energy provide my electricity. I have a smart meter. I want to set up a daily budget and track against it. If I near 80% of my daily budget, I would like to get an alert. Please write me a code that allows me to authenticate myself with Octopus Energy, retrieve the smart meter data and achieve my objective above.
2. ChatGPT responded with the following starting response
3. It took some tinkering and troubleshooting to create a webapp out of it. The code that was finally written for the webapp is in the git repository here — I have removed my personal details; but otherwise it should work for you.
4. Octopus Energy API documentation => https://developer.octopus.energy/docs/api/