Skip to content

pdbayes/oebd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Octopus Energy Bill Downloader (OEBD)

OEBD is a tool for getting Octopus Energy bill PDFs automatically. The original use-case for this tool was for automatic consumption into Paperless-ngx; see the docker-compose.yml example, which I run in Portainer in my Paperless-ngx stack.

Run once example output

Once example output

Daemon example output

Daemon example output

Paperless screenshot

Paperless screenshot

Usage

Docker

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

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

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.

About

Octopus Energy Bill Downloader

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 97.9%
  • Dockerfile 2.1%