7dd3215520
MQTT-Collector (Python/paho-mqtt) speichert abgeschlossene go-e Wallbox-Ladungen in SQLite; Next.js-Web-App zeigt sie als Tabelle mit Energie-Summen (Monat/Jahr/gesamt) im werte-next-Design. Zwei Docker-Container mit gemeinsamem DB-Volume. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
18 lines
499 B
SQL
18 lines
499 B
SQL
PRAGMA journal_mode=WAL;
|
|
|
|
CREATE TABLE IF NOT EXISTS charges (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
start_time TEXT NOT NULL, -- ISO 8601, lokale Zeit (Europe/Berlin)
|
|
end_time TEXT NOT NULL,
|
|
duration_s INTEGER NOT NULL, -- aus cdi.value (ms/1000)
|
|
energy_wh REAL NOT NULL, -- aus wh
|
|
created_at TEXT NOT NULL
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_charges_start ON charges(start_time);
|
|
|
|
CREATE TABLE IF NOT EXISTS meta (
|
|
key TEXT PRIMARY KEY,
|
|
value TEXT
|
|
);
|