- π Octopus - Free Electric!!! β‘APP β 10:45
- π°οΈ 12-2pm, Saturday 4th October
 - π£ T- 5mins to Delta!
 - π° End State
 
 
- 
π° saving sessions are free electric periods (usually 1-2hrs) frequent during strong winds
- π©βπ» 48 hours prior Octopus Energy send an email to the account holder
 - β we then forget to act, missing out on free energy
 - β hence octofree will ping your mobile!
 
 - 
π§ the script scans https://octopus.energy/free-electricity/
- π extracts the next saving session date & time
 - π± sends you a discord webhook notification on your mobile
 - π£ reminds you again 5mins before saving session starts
 - π° warns 3mins before the end state
 
 
- octopus energy customer + signed up to saving sessions
 - 24/7 powered - server | pc | mac | raspberry pi | etc
- internet access
 - python3
 - discord webhook [server]
 
 - discord [mobile device]
 
Virtual Environment
Preferred method is docker but you can also run in a Python virtual environment located a .venv folder
- create the virtual environment:
 
python3 -m venv .venv- activate the virtual environment (macOS/Linux):
 
source .venv/bin/activate- set settings in settings.env
 - run the script
 
 python3 octofree/octofree.py Unraid Server
- add CONTAINER
 - repo url:
 
ghcr.io/dopeytree/octofree:latest - advanced --> icon url:
 
https://github.com/dopeytree/octofree/blob/61e16adea141812f674ca91d86ab697ac02e0c91/logo_octofree.png?raw=truekey=
DISCORD_WEBHOOK_URLvalue=enter_your_discord_server_webhook
key=
TEST_MODEvalue=
falsekey=
SINGLE_RUNvalue=
falsecontainer path=
  /datahost path=
/mnt/user/appdata/octofreeDocker
- Official published image on GitHub Container Registry :
 
docker pull ghcr.io/dopeytree/octofree:latestRun the published image (recommended):
docker run --rm \
  --env-file ./octofree/settings.env \
  -v /path/on/host/octofree-data:/data \
  ghcr.io/dopeytree/octofree:latest- Use 
--env-file ./octofree/settings.envor set individual-evariables to provide yourDISCORD_WEBHOOK_URL,OUTPUT_DIR, and other options- If no 
settings.envfile exists in your workspace, copy or create one fromoctofree/settings.env.template 
 - Bind-mount a host folder to persist logs and state
- Set 
OUTPUT_DIR=/data(or another mounted path) so theoutput/files appear on the host 
 - Set 
 
# Build locally (if you need to modify code or prefer a local image)
docker build -t octofree ./octofree# Run the locally built image
docker run --rm --env-file ./octofree/settings.env -v /path/on/host/octofree-data:/data octofreeIf you want the helper script and vulnerability scan, run the included ./octofree/build.sh (it builds the image and runs a Trivy scan).
version: '3.8'
services:
  octofree:
    image: ghcr.io/dopeytree/octofree:latest
    environment:
      - DISCORD_WEBHOOK_URL=${DISCORD_WEBHOOK_URL}
      - OUTPUT_DIR=/data
      - SINGLE_RUN=false
      - TEST_MODE=false
    volumes:
      - /path/on/host/octofree-data:/data
    restart: unless-stopped- If you change 
settings.envlocally, avoid rebuilding by supplying--env-fileor-evariables atdocker runtime - Check logs and last-sent session inside the mounted folder (
octofree.log,last_sent_session.txt) when debugging notifications - The 
build.shscript runs Trivy; if you don't have Trivy available you can skip it and usedocker builddirectly 
see settings.env
Discord Webhook Notification
- [required for notifications]
 - load or create a server in discord
 - create a new channel called 'octofree'
 - click the cogs to get the settings then find the webhooks button
 - create a new webhook & copy the url
 - set your discord webhook URL in 
settings.env 
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/...Test Mode
- allows multiple notifcation testing when 1x is live
 - DEFAULT=
falseto send only 1x notification per saving sessions - set to 
trueto send > than 1x notification per current session truecurrently only works during an active saving sessiontruesends time date, then 1min sends 5min delta, then end statetrueallows testing of discord on mobile etc
TEST_MODE=false
TEST_MODE=trueSingle Run
- to loop or not
 - true = runs the script once & exits (instead of looping every hour)
 - DEFAULT=false
 - set to 
falsefor continuous hourly monitoring 
SINGLE_RUN=false
SINGLE_RUN=trueSee console for octofree.log
- Check your setup for the exact path to the storage ouput folder
 output/octofree.log- main log file for all activity and errors
 
output/last_sent_session.txt- tracks the last session for which a notification was sent
 

