Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ellevio

Fetch your electricity consumption from Ellevio ("Mina sidor") and store it in a local SQLite database, then visualize it in a web dashboard.

Two pieces share one SQLite file — there is no backend API in between:

  • ellevio.py — a single-file Python CLI that logs in, fetches consumption readings, and stores them in SQLite.
  • webui/ — a Solid 2.0 (RC) + SolidStart dashboard that reads that database directly (via node:sqlite) and charts it. See webui/README.md for frontend details.

Requirements

  • Python 3.14 (managed by mise via mise.toml) and uv.
  • Node.js 24+ for the web UI (SolidStart v2 + node:sqlite).

Setup

uv run ellevio.py init          # write ~/.config/ellevio/config.toml

Edit config.toml and fill in your real values:

[ellevio]
anlage_ids = ["735999XXXXXXXXXXX", "735999YYYYYYYYYYY"]
customer_id = "XXXXXXXX"

The Anläggnings-ID(s) and customer ID are on your Ellevio invoice or in the Mina sidor UI. Paths in config.toml accept ~.

Authenticate (pick one)

Recommended — automatic re-login:

uv run ellevio.py login

Prompts for your email/password once, stores them in the OS keyring, and writes fresh cookies. After this, get can run unattended (e.g. from cron): when a session expires, it re-logs in with the stored credentials and resumes.

Fallback — no credentials on disk:

uv run ellevio.py extract-cookies --browser chrome

Copies your existing Ellevio session out of a browser. These cookies expire and are not renewed automatically, so re-run this when get starts failing with an AuthenticationError.

Fetch data

uv run ellevio.py get

Fetches yesterday for every configured installation at the configured resolution (default QuarterHourly) and stores it in SQLite. Re-fetching an already-stored period overwrites it — no duplicates. Useful flags:

uv run ellevio.py get --from lastmonth --to today --resolution Daily
uv run ellevio.py get --anlage-id 735999XXXXXXXXXXX --interval Monthly
uv run ellevio.py get --output ~/consumption.json

Run uv run ellevio.py get --help for the full flag list. Date expressions include today, yesterday, week, lastweek, month, lastmonth, year, <N>d, or a literal YYYY-MM-DD.

Web dashboard

uv run ellevio.py ui

Builds the UI on first run (and installs webui dependencies), starts the server, and opens the dashboard in your browser. Ctrl-C tears the server down cleanly. Flags: --port, --host, --db, --no-open, --rebuild.

Layout

ellevio.py            The CLI: config, auth, fetch, storage, UI launcher.
requirements.txt      Python deps: requests, browser-cookie3, keyring.
mise.toml             mise tasks (install/run) and a pinned Python venv.
webui/                Solid 2.0 (RC) + SolidStart dashboard.
~/.config/ellevio/    Runtime state (git-ignored): config.toml, cookies.txt,
                      ellevio.db (the single source of truth).

Privacy

Your data never leaves your machine: the SQLite DB, cookies, and config (including credentials) live under ~/.config/ellevio/ and are git-ignored. Only this code is published.

About

Fetch Ellevio electricity consumption into SQLite + Solid 2 web dashboard

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages