No description
  • Python 56.6%
  • Vue 38.2%
  • TypeScript 4%
  • Shell 0.7%
  • Dockerfile 0.3%
  • Other 0.2%
Find a file
2026-07-15 17:17:59 +02:00
backend Energiöversikt: Swedish energy dashboard 2026-07-15 17:17:59 +02:00
docs Energiöversikt: Swedish energy dashboard 2026-07-15 17:17:59 +02:00
frontend Energiöversikt: Swedish energy dashboard 2026-07-15 17:17:59 +02:00
.dockerignore Energiöversikt: Swedish energy dashboard 2026-07-15 17:17:59 +02:00
build-and-push.sh Energiöversikt: Swedish energy dashboard 2026-07-15 17:17:59 +02:00
Dockerfile Energiöversikt: Swedish energy dashboard 2026-07-15 17:17:59 +02:00
LICENSE Energiöversikt: Swedish energy dashboard 2026-07-15 17:17:59 +02:00
PLAN.md Energiöversikt: Swedish energy dashboard 2026-07-15 17:17:59 +02:00
README.md Energiöversikt: Swedish energy dashboard 2026-07-15 17:17:59 +02:00

Energiöversikt — Swedish Energy Dashboard

An interactive energy data platform for Sweden combining real-time electricity prices, weather-driven solar/wind estimation, EV charging optimization, and price forecasting via linear regression.

Features

  • Map of Sweden — Interactive MapLibre map with zone-based price coloring across the four bidding zones (SE1SE4)
  • Price dashboard — Live Nord Pool day-ahead prices with 24-hour curves and weekly history
  • EV charging optimizer — Compute the cheapest charging schedule based on user parameters (battery, charger, solar panels, grid tariff)
  • Solar production estimation — Estimate solar panel output using Open-Meteo irradiance data
  • Price forecast — Linear regression model trained on historical prices and weather to predict day-ahead prices

Architecture

frontend/          Vue 3 + TypeScript + Vite + MapLibre GL JS
backend/           Python FastAPI + SQLite

Data sources:

  • Nord Pool — Day-ahead electricity spot prices via ENTSO-E / Utilitarian Spot
  • Open-Meteo — Weather forecasts, solar irradiance, wind, historical weather (ERA5)

Quick Start

Backend

cd backend
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --host 0.0.0.0 --port 8000

On first start, the backend bootstraps 3 years of historical prices and weather (may take a minute). Subsequent starts use cached data.

A midnight maintenance job runs automatically to retrain the price forecast model and clean up old data.

Frontend

cd frontend
npm install
npm run dev

Docker

docker build -t energioversikt .
docker run -p 8000:8000 energioversikt

The combined Docker image serves the built frontend as static files from the backend.

Testing

cd backend
pytest

API Endpoints

Method Path Description
GET /api/health Health check
GET /api/prices/current Current 24h prices for all zones
GET /api/prices/history/{zone} Historical prices by year/month/day (requires year query param, optional month/day)
GET /api/prices/zones Zone metadata
GET /api/weather/forecast Weather forecast (requires lat/lon query params)
GET /api/weather/history Historical weather (requires lat/lon/start_date/end_date query params)
GET /api/solar/forecast Solar panel output estimate (requires lat/lon query params)
POST /api/optimize/charging Optimal EV charging schedule
POST /api/historical/bootstrap Bootstrap 3 years of historical prices and weather
POST /api/historical/calibrate Run price forecast calibration
GET /api/historical/calibrate/{zone} Trained model coefficients
POST /api/historical/store-today Store today's prices

Environment Variables

All settings are prefixed with ENERGI_ and are optional:

Variable Default Description
ENERGI_UTILITARIAN_BASE_URL https://spot.utilitarian.io Nord Pool price API base URL
ENERGI_OPENMETEO_BASE_URL https://api.open-meteo.com/v1 Open-Meteo weather API base URL
ENERGI_OPENMETEO_ARCHIVE_URL https://archive-api.open-meteo.com/v1 Open-Meteo historical weather API base URL
ENERGI_CACHE_DB data/cache.db SQLite cache path
ENERGI_PRICE_CACHE_TTL_MINUTES 5 Price cache lifetime
ENERGI_WEATHER_CACHE_TTL_MINUTES 30 Weather cache lifetime
ENERGI_EUR_TO_SEK_FALLBACK 11.0 Fallback FX rate

Configuration

  • Electricity tax, VAT rate, and grid tariff models are in backend/app/data/grid_tariffs.py
  • Zone coordinates are in backend/app/data/zone_coords.py
  • Supported grid tariffs: vattenfall_flat, vattenfall_tou