Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/olliejc/oebd
Octopus Energy Bill Downloader
https://github.com/olliejc/oebd
octopus-energy paperless-ngx utility-billing
Last synced: 10 days ago
JSON representation
Octopus Energy Bill Downloader
- Host: GitHub
- URL: https://github.com/olliejc/oebd
- Owner: OllieJC
- License: unlicense
- Created: 2023-10-18T12:07:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-28T03:37:33.000Z (5 months ago)
- Last Synced: 2025-01-05T12:42:45.019Z (17 days ago)
- Topics: octopus-energy, paperless-ngx, utility-billing
- Language: Python
- Homepage:
- Size: 518 KB
- Stars: 20
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Octopus Energy Bill Downloader (OEBD)
OEBD is a tool for getting [Octopus Energy](https://octopus.energy/) bill PDFs automatically. The original use-case for this tool was for automatic consumption into [Paperless-ngx](https://github.com/paperless-ngx/paperless-ngx); see the [docker-compose.yml](docker-compose.yml) example, which I run in Portainer in my Paperless-ngx stack.
### Run once example output
![Once example output](oebd_output_once.png)### Daemon example output
![Daemon example output](oebd_output_daemon.png)### Paperless screenshot
![Paperless screenshot](oebd_paperless.png)## Usage
### Docker
``` sh
mkdir -p ./bills# One time download of past 12 bills
docker run \
-e OCTOPUS_USERNAME="abc@email" \
-e OCTOPUS_PASSWORD="123" \
-e BILL_COUNT="12" \
-e DOWNLOAD_TIME="ONCE" \
-v "${pwd}/bills:/app/consume" \
-e SAVE_LOCATION="/app/consume" \
--name oebd_once \
-t ghcr.io/olliejc/oebd
# -t $(docker build -q .)# Scheduled looping downloader
docker run \
-e OCTOPUS_USERNAME="abc@email" \
-e OCTOPUS_PASSWORD="123" \
-v "${pwd}/bills:/app/consume" \
-e SAVE_LOCATION="/app/consume" \
--name oebd_daemon \
--restart=unless-stopped \
-d ghcr.io/olliejc/oebd
# -d $(docker build -q .)
```### Linux
``` sh
python3 -m pip install -r requirements.txt# One time download of past 12 bills
DOWNLOAD_TIME="ONCE" BILL_COUNT=12 OCTOPUS_USERNAME="abc@email" OCTOPUS_PASSWORD="123" python3 downloader.py# Scheduled looping downloader
OCTOPUS_USERNAME="abc@email" OCTOPUS_PASSWORD="123" python3 downloader.py
```### Windows
``` powershell
python3 -m pip install -r requirements.txt# One time download of past 12 bills
$env:DOWNLOAD_TIME="ONCE"
$env:BILL_COUNT=12
$env:OCTOPUS_USERNAME="abc@email"
$env:OCTOPUS_PASSWORD="123"
python3 downloader.py# Scheduled looping downloader
$env:OCTOPUS_USERNAME="abc@email"
$env:OCTOPUS_PASSWORD="123"
python3 downloader.py
```## Configuration
Environment variables are used to configure the downloaders. The following are available:
|Variable|Purpose|
|-|-|
|OCTOPUS_USERNAME|Your Octopus Energy account email address (used to generate GraphQL JWT)|
|OCTOPUS_PASSWORD|Your Octopus Energy account password (used to generate GraphQL JWT)|
|DOWNLOAD_TIME|Set to a time (e.g. 00:30) for the autorun or "ONCE" for one-time download, defaults to random time|
|BILL_COUNT|Set how many bills to download at a time, defaults to 1|
|SAVE_LOCATION|Set the download location, defaults to pwd / "."|## TODO
* The current method for scheduled downloads is very yucky (while loop...) and needs work.