Each hourly row now carries the N1 time-of-use tariff (øre/kWh × 10
to match the DKK/MWh unit of price_dkk) and the combined consumer
price (spot + tariff). Existing rows are backfilled in the migration
with a CASE expression mirroring tariffs/tariff-for-hour; new writes
compute it in the controller. API response exposes both fields.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
New `elprice` table with a simpler shape (time_dk, price_area,
price_dkk) backing a JSON endpoint that returns hourly DK1 + DK2
prices for any date. Cache-miss path fetches from the same
DayAheadPrices dataset as day_ahead_prices, upserts, and returns.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Records hourly solar panel readings imported from /home/pmp/ai/solar/csv
by the sibling repo's import-csv.mjs. Schema includes only the 8
columns that always carry data; the 5 always-empty CSV columns are
dropped.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add production and consumption table migrations. Fix sync-month.sh
to use Linux date syntax and default to port 3030. Read Eloverblik
token from ELOVERBLIK_TOKEN env var with .token file fallback.
Mount .token into Docker container.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add eloverblik controller with API client for metering points, time series, and charges
- Add migrations for metering_points, meter_readings, and charges tables
- Add HugSQL queries (upsert-metering-point!, insert-meter-reading!, insert-charge!)
- Add POST /eloverblik/sync route to trigger sync from browser
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Changed upsert to INSERT ON CONFLICT DO NOTHING so existing prices are
never overwritten. Added unique index on (time_dk, price_area) to enforce
no duplicate quarter-hour entries per area.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a prices controller that fetches DK1/DK2 hourly spot prices via the
Energi Data Service API, stores them in PostgreSQL, and displays today's
and tomorrow's DK1 prices on the home page in øre/kWh. An HTMX "Refresh
Prices" button triggers the fetch-and-display cycle.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>