-
Notifications
You must be signed in to change notification settings - Fork 10
feat(prices): static / time-of-use tariff so planning works outside Europe #1051
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
frahlg
wants to merge
2
commits into
master
Choose a base branch
from
emdash/docs-coverage-table-provider-product-api-718-lqdfr
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "ftw": minor | ||
| --- | ||
|
|
||
| A static / time-of-use price provider, so price-driven planning works outside Europe. | ||
|
|
||
| `price.provider: static` takes a flat rate in the install currency, plus optional local-time windows that override peak hours (overnight wrap, optional weekdays). Grid tariff and VAT still apply. Live day-ahead spot remains Europe-only; this is the stand-in for every other market. Settings and the setup wizard offer it next to Sourceful and ENTSO-E. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| # Geographic coverage of external data sources | ||
|
|
||
| FTW controls hardware anywhere. The data it plans with does not. | ||
|
|
||
| - **Weather and PV forecasting works worldwide.** | ||
| - **Day-ahead spot prices work in Europe only.** | ||
| - **A static / time-of-use tariff works anywhere.** That is how a site | ||
| outside ENTSO-E (or on a flat retail contract inside it) gets | ||
| price-driven planning. | ||
|
|
||
| A site outside Europe still gets monitoring, safety, control, the | ||
| dashboard, weather forecasts and the self-learning PV twin. What it did | ||
| not have, until `price.provider: static`, was a price source. | ||
|
|
||
| ## Spot prices — Europe, or a tariff you type | ||
|
|
||
| Configured under `price.provider`. | ||
|
|
||
| | Provider | Coverage | API key | Notes | | ||
| |---|---|---|---| | ||
| | `sourceful` | European day-ahead markets | No | Default. Sourceful's cached ENTSO-E API. | | ||
| | `elprisetjustnu` | **Sweden only** — zones SE1–SE4 | No | 15-minute PTU since late 2025. | | ||
| | `entsoe` | ENTSO-E member markets | Yes | Direct from the Transparency Platform. | | ||
| | `static` | **Worldwide** | No | Flat rate or time-of-use schedule the operator types. | | ||
| | `none` | — | — | Disables price fetching entirely. | | ||
|
|
||
| There is still no live adapter for CAISO, ERCOT, PJM, AEMO/NEM, JEPX or | ||
| the other non-European markets. `static` is the stand-in: a US TOU | ||
| tariff, a Japanese flat contract, or any other schedule that can be | ||
| written as hours and a rate. | ||
|
|
||
| Prices are stored in **minor units of the configured currency** per kWh | ||
| (öre, cent, ¢, pence, …). ENTSO-E figures that arrive in another | ||
| currency are converted with **ECB** daily FX rates. Static prices are | ||
| already in the install currency; nothing is converted. | ||
|
|
||
| > The Tibber driver (`drivers/tibber.lua`) is telemetry only — it reports | ||
| > meter readings, not prices, so it is not a fifth price source. | ||
|
|
||
| ```yaml | ||
| price: | ||
| provider: static | ||
| currency: USD | ||
| static_ore_kwh: 8 # off-peak, ¢/kWh (minor units) | ||
| static_tou: | ||
| - { start: "07:00", end: "23:00", ore_kwh: 22 } # peak | ||
| grid_tariff_ore_kwh: 4 | ||
| vat_percent: 0 | ||
| ``` | ||
|
|
||
| Windows are local time on the box. First match wins; hours they miss | ||
| keep `static_ore_kwh`. Overnight windows wrap (`22:00`–`06:00`). An | ||
| optional `days` list (`mon`…`sun`) limits a window to those weekdays. | ||
|
|
||
| The zone picker is served from `GET /api/prices/zones` and is hidden | ||
| when the provider is `static`. See | ||
| [`go/internal/prices/zones.go`](../go/internal/prices/zones.go) and | ||
| [`go/internal/prices/static.go`](../go/internal/prices/static.go). | ||
|
|
||
| ## Weather and PV forecasts — worldwide | ||
|
|
||
| Configured under `weather.provider`. All four work at any latitude/longitude. | ||
|
|
||
| | Provider | Coverage | API key | Signal quality | | ||
| |---|---|---|---| | ||
| | `met_no` | Global | No | Cloud cover only — weakest PV signal. | | ||
| | `openweather` | Global | Yes | Cloud cover only. | | ||
| | `open_meteo` | Global | No | Shortwave radiation (GHI) — good. | | ||
| | `forecast_solar` | Global | No (free tier) | Site-calibrated watts from panel geometry — best. | | ||
|
|
||
| Prefer `open_meteo` or `forecast_solar` when the site has array | ||
| geometry: they carry an irradiance signal, which is what the | ||
| orientation-aware plane-of-array model needs. | ||
|
|
||
| ## What is not in this tree yet | ||
|
|
||
| | Capability | Planned source | Coverage when it lands | | ||
| |---|---|---| | ||
| | PV performance scoring / forecast calibration | SMHI STRÅNG ([#734](https://github.com/srcfl/ftw/pull/734)) | Nordic region only | | ||
| | Automatic roof geometry | Lantmäteriet via STAC ([#735](https://github.com/srcfl/ftw/pull/735)) | Sweden by default; any conformant STAC catalog | | ||
|
|
||
| Until those land, array geometry stays a manual entry on the Weather | ||
| tab, and the PV twin still calibrates from measured production. | ||
|
|
||
| ## What a non-European site has today | ||
|
|
||
| | Capability | Works outside Europe? | | ||
| |---|---| | ||
| | Device control, safety, dispatch | Yes | | ||
| | Telemetry, history, dashboard | Yes | | ||
| | Weather + PV forecasting | Yes | | ||
| | Self-learning PV twin | Yes | | ||
| | Price-driven planning | **Yes, via `static`** | | ||
| | Live day-ahead spot | **No** — Europe only | | ||
| | Manual array geometry | Yes | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zero VAT treated as Swedish default
High Severity
FromConfigtreatsvat_percent: 0as unset and substitutes 25%. The new static path documents and targets non-EU tariffs with no VAT, so every storedTotalOreKwhis 25% too high and the planner prices grid actions wrong.Additional Locations (1)
docs/data-coverage.md#L39-L49Reviewed by Cursor Bugbot for commit b8ecc20. Configure here.