I recently made some small changes to my simple mobile-friendly web app to display the daily “Greener Nights” forecast from the Octopus Energy GB API. This is at unop.uk/gnights. However, it turned into a bit of a rabbit hole…

So, I’ve also created an archive to record how the forecast updates over time, showing days that were greener but are no longer. A web app to display this is at jpsingleton.github.io/greener-nights-history. Days that were greener nights are shown with smaller grey arrows.
Finally, I’ve added iCalendar support. Simply subscribe to the following URL in your calendar application of choice (e.g. Mozilla Thunderbird).
https://raw.githubusercontent.com/jpsingleton/greener-nights-history/refs/heads/main/greener-nights-history.ics
We Are History
This project uses the git scraping technique.
A GitHub action uses curl and jq to archive the JSON data. It also adds a new wasGreenerNight property to surface this info beyond the git history.
Note, I needed to add permissions: contents: write to the YAML (you could allow it in actions settings instead with a wider scope) for the workflow to work.
The workflow is scheduled to run a few times a day, as GitHub actions aren’t that reliable.
There is also a Python script that runs to post-process the JSON into an iCal file. This is a really convenient way to see the forecast along with your other events.
More details in the repository. Enjoy!