TARIFF-07: three plugins that never fetched a price are withdrawn, and a site configured on one is told so
checks / unit (pull_request) Successful in 7m12s
checks / unit (pull_request) Successful in 7m12s
engie_dynamic, totalenergies_dynamic and eneco_eddy are removed from PROVIDERS and from every surface that listed them. They did not stop working - they never worked. Re-verified by hand on 2026-09-13 before deleting anything: 404 with Kong's "no Route matched with those values"; a TLS handshake that fails because api.totalenergies.be is absent from the certificate's SAN list; 404 with an empty body. All three are also structurally impossible - the coefficients are per-contract and behind a customer login, there is no regulator index, and "Eddy" is not an Eneco product at all. ⚠️ BACKWARD-INCOMPATIBLE. A config legal on the current version is refused on the next. That is the point of the change: §11.4 turned every failed fetch into a silent fall back, so a site on one of these ids has been running on static_profile - or on nothing - since the day it was set, with nothing on its status page ever differing from a working provider that never found a cheap hour. validate.py now refuses a retired id with a message naming the id, the endpoint, what that endpoint answers, which tariff has really been in force, and what to set instead. No version number is picked here; that depends on a fact about the live box. ⚠️ config.yaml's price_provider enum deliberately KEEPS all three ids. The Supervisor validates the options file against that enum before the add-on starts, so removing them would make an existing config schema-invalid and the refusal above would never be reached on exactly the sites that need it. PROVIDERS is two; the enum stays six; test_price.py asserts the schema offers exactly PROVIDERS | RETIRED_PROVIDERS | {"off"}, derived rather than typed, and register() refuses to re-register a retired id. PriceProduct.REALTIME, _WIDE, Uncertainty.REALTIME_PRODUCT and WIDEN_FACTOR's 2.5 are KEPT with no shipped declarer - it is the AC2 seam, and a reviewer finding a mechanism with zero callers would reasonably delete it. Recorded in DECISIONS/TARIFF-07-withdrawing-three-plugins.md and pinned by a check. False claims corrected: every "Belgian imbalance product" claim about eneco_eddy (DOCS.md, price_forecast.py, price_history.py, static_tariff.py, FCST-04, CHANGELOG - the two released entries annotated in place rather than rewritten); the quarter-hourly examples now cite Belgian day-ahead, which really does settle per quarter since the 15-minute MTU; and export_price_eur_kwh's "no shipped supplier publishes a dynamic injection curve", which is false - Eneco publishes 0,1 x BELPEX-H - 1,188 and ENGIE (B x eSpot_15) - A, same two-coefficient shape with its own coefficients and its own VAT treatment, so the scalar is a simplification and not the market. DOCS.md's provider table is two rows and now says honestly what a Belgian dynamic customer should do today, including that generic_dayahead cannot express B x spot + A and that price_markup_eur_kwh: float(0,1) could not hold a negative offset. The formula provider is referenced as planned, not built. _points_from_json() went with the plugins it served: it read a shape no feed anybody here has ever reached publishes. The one place it survives is a negative stimulus, named row_shape_body(). Nine mutations driven, all red; table in the decision record. 29/29 suites green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BwRLw7eKYj2byVdwB6kbjU
This commit is contained in:
+129
-160
@@ -63,14 +63,21 @@ THE THREE THINGS THIS MODULE IS SHAPED BY
|
||||
knowing which of those two things you are reading.
|
||||
|
||||
2. THE PRODUCT TYPE IS DECLARED, NOT INFERRED FROM THE PLUGIN'S NAME.
|
||||
`eneco_eddy` is a real-time / imbalance product (§9.2) and §8.3 says those
|
||||
are treated as high-volatility with widened arbitrage thresholds. If the
|
||||
optimiser has to write `if provider_id == "eneco_eddy"` to know that, then
|
||||
adding a sixth supplier means editing the optimiser - which is precisely
|
||||
what AC2 forbids. So `capabilities().product` is a `PriceProduct`, it rides
|
||||
along on the series, and `volatility_regime()` reads the enum. A plugin id
|
||||
appears nowhere in this file except in `PROVIDERS` and in the class that
|
||||
answers to it.
|
||||
§9.2 classes real-time / imbalance products separately from day-ahead ones
|
||||
and §8.3 says those are treated as high-volatility with widened arbitrage
|
||||
thresholds. If the optimiser had to write `if provider_id == "<supplier>"`
|
||||
to know that, then adding a supplier would mean editing the optimiser -
|
||||
which is precisely what AC2 forbids. So `capabilities().product` is a
|
||||
`PriceProduct`, it rides along on the series, and `volatility_regime()`
|
||||
reads the enum. A plugin id appears nowhere in this file except in
|
||||
`PROVIDERS`, in `RETIRED_PROVIDERS`, and in the class that answers to it.
|
||||
|
||||
⚠️ NO SHIPPED PLUGIN DECLARES `PriceProduct.REALTIME` (TARIFF-07). Both
|
||||
shipped plugins are day-ahead, so `_WIDE`, `Uncertainty.REALTIME_PRODUCT`
|
||||
and `WIDEN_FACTOR`'s 2.5 currently have no shipped declarer. They are KEPT
|
||||
deliberately - see DECISIONS/TARIFF-07-withdrawing-three-plugins.md - and
|
||||
test_price.py section 10 keeps them live by declaring REALTIME from a class
|
||||
defined outside this file, which is AC2's own stimulus.
|
||||
|
||||
3. "NO PRICE DATA" IS A TYPE, NOT AN EMPTY LIST.
|
||||
§11.4: no price data -> fall back to the static profile, mark the plan
|
||||
@@ -480,7 +487,6 @@ class ProviderCapabilities:
|
||||
product: PriceProduct
|
||||
sources: frozenset # which Components the published figure contains
|
||||
horizon_h: int = 48 # aligns with the §8.1/§8.2 forecast horizon
|
||||
needs_credentials: bool = False
|
||||
egress_hosts: tuple = () # §16 allow-list, declared not discovered
|
||||
|
||||
def __post_init__(self):
|
||||
@@ -962,11 +968,28 @@ def export_price_eur_kwh(opts: dict) -> float:
|
||||
"""AC4 / §9.3: the injection price is a SEPARATE SCALAR, not a second series.
|
||||
|
||||
In Belgium it is often near zero, which by itself favours self-consumption
|
||||
over export. It is deliberately not routed through the plugin framework: no
|
||||
shipped supplier publishes a dynamic injection curve, and inventing the
|
||||
shape for one would be a second canonical format nobody emits. When one
|
||||
appears it gets a `PriceProvider` of its own and this scalar becomes its
|
||||
FIXED-product default - the seam is already the right shape for that.
|
||||
over export. It is deliberately not routed through the plugin framework -
|
||||
but ⚠️ NOT because nothing dynamic exists to route. That claim stood here
|
||||
until TARIFF-07 and it was FALSE:
|
||||
|
||||
* Eneco publishes an injection formula on the same tariff card as its
|
||||
consumption formula - `0,1 x BELPEX-H - 1,188` - identical on the
|
||||
January and the September 2026 cards;
|
||||
* ENGIE publishes one in the same two-coefficient shape,
|
||||
`(B x eSpot_15) - A`.
|
||||
|
||||
So a supplier DOES publish a dynamic injection curve. What is true is
|
||||
narrower and is the actual reason this is a scalar: an injection curve is
|
||||
the SAME `B x spot - A` shape as the consumption curve but carries ITS OWN
|
||||
coefficients and its own VAT treatment - injection is VAT-exempt where
|
||||
consumption is at 6% - so it is a second per-contract formula, not a second
|
||||
copy of the first. Nothing in this add-on can evaluate either one yet
|
||||
(`generic_dayahead` cannot express `B x spot + A` at all; the formula
|
||||
provider is a separate card). Until it can, this scalar is a SIMPLIFICATION
|
||||
an operator enters by hand - an average of what they are actually paid -
|
||||
and not a reflection of the market. When the formula provider lands, an
|
||||
injection curve gets a `PriceProvider` of its own and this scalar becomes
|
||||
its FIXED-product default; the seam is already the right shape for that.
|
||||
|
||||
⚠️ It is NOT reachable from a plugin: `export_price_eur_kwh` is in
|
||||
FRAMEWORK_KEYS, so a consumption plugin cannot quietly fold an injection
|
||||
@@ -1013,16 +1036,14 @@ class PriceProvider(ABC):
|
||||
past today from the trade set as provisional - so the optimiser never
|
||||
saw tomorrow as firm, at any hour of any day, and nothing reported it.
|
||||
|
||||
This promise is NOT mechanically enforced, and the honest reason is
|
||||
TARIFF-08's: three of the five shipped plugins point at endpoints
|
||||
nobody has verified (TARIFF-07 is the open decision on withdrawing
|
||||
them), so nobody knows how those feeds spell a date range. A rule
|
||||
obliging them to pass one would be satisfied by an INVENTED parameter
|
||||
This promise is NOT mechanically enforced. A rule obliging every
|
||||
plugin to pass a range would be satisfied by an INVENTED parameter
|
||||
name - the parser-graded-against-its-own-guess defect, moved from the
|
||||
response to the request. What exists instead is a roster pin in
|
||||
test_price.py: which plugins consume the range and which do not is
|
||||
asserted as a literal, so a sixth supplier, or a change to one of the
|
||||
three, forces the decision rather than inheriting the silence.
|
||||
response to the request, and the defect TARIFF-08 found on the
|
||||
response side. What exists instead is a roster pin in test_price.py:
|
||||
which plugins consume the range and which do not is asserted as a
|
||||
literal, so a third supplier forces the decision rather than
|
||||
inheriting the silence.
|
||||
"""
|
||||
|
||||
|
||||
@@ -1050,9 +1071,10 @@ def code_leaks(cls) -> list:
|
||||
|
||||
⚠️ DOCSTRINGS ARE STRIPPED BEFORE THE SEARCH, AND THAT IS NOT COSMETIC.
|
||||
Every shipped plugin's docstring is REQUIRED to name the components it
|
||||
sources, so `engie_dynamic` says "markup" in prose and would false-positive
|
||||
against `price_markup_eur_kwh` on a raw text scan. The check that fires on
|
||||
the documentation it also mandates is the check that gets deleted. So the
|
||||
sources, so `generic_dayahead` says "markup" in prose and would
|
||||
false-positive against `price_markup_eur_kwh` on a raw text scan. The
|
||||
check that fires on the documentation it also mandates is the check that
|
||||
gets deleted. So the
|
||||
class is parsed, every docstring node is dropped, and the search runs on
|
||||
`ast.unparse` of what is left - i.e. on code, which is the only thing that
|
||||
can actually add a number twice.
|
||||
@@ -1062,8 +1084,8 @@ def code_leaks(cls) -> list:
|
||||
or zipapp build would not. Refusing to start a battery controller because a
|
||||
STATIC ANALYSIS could not run would trade a real outage for a hypothetical
|
||||
accounting error, so an unreadable source returns `[]` and logs. CI proves
|
||||
the scan really runs: test_price.py asserts source was found for all five
|
||||
shipped plugins, so a build that silently lost it is a red check, not a
|
||||
the scan really runs: test_price.py asserts source was found for every
|
||||
shipped plugin, so a build that silently lost it is a red check, not a
|
||||
quietly disarmed guard.
|
||||
"""
|
||||
try:
|
||||
@@ -1082,6 +1104,58 @@ def code_leaks(cls) -> list:
|
||||
return sorted({name for name in BANNED_IN_PLUGIN_CODE if name in code})
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- #
|
||||
# TARIFF-07: the ids that USED to resolve here, and what an operator on one of
|
||||
# them has actually been running.
|
||||
#
|
||||
# ⚠️ THE DEFECT THIS EXISTS TO PREVENT: A RETIRED ID READ AS A TYPO. Without
|
||||
# this table `price_provider: "eneco_eddy"` reaches validate.py's unknown-id
|
||||
# branch and is refused as "not a shipped plugin" - true, and useless. The
|
||||
# operator did not mistype it; it WAS a shipped plugin, they chose it on
|
||||
# purpose, and the add-on has accepted it every startup since. What they need
|
||||
# told is not "that id is wrong" but "that id never fetched a price, and here
|
||||
# is what you have been running instead" - because §11.4 turned every failed
|
||||
# fetch into a silent fall back to `static_profile`, so NOTHING they can see
|
||||
# has ever differed from a working provider that finds no cheap hour.
|
||||
#
|
||||
# ⚠️ AND WHY THERE IS NO SILENT ALIAS. Mapping these to `generic_dayahead`
|
||||
# would be the friendlier-looking option and it is the wrong one: these three
|
||||
# published RETAIL prices (`B x spot + A`, per contract) and `generic_dayahead`
|
||||
# reads WHOLESALE. Aliasing needs the site's own two coefficients, which nobody
|
||||
# has - they live behind the customer's klantenzone login, and there is no
|
||||
# regulator index to read them from (CREG's tariff-card pages 404; VREG was
|
||||
# unreachable; every coefficient found in research came from a supplier's own
|
||||
# PDF). An alias would therefore have to INVENT the numbers it prices a battery
|
||||
# against, which is the same class of defect as the parser graded against its
|
||||
# own guess - just one layer further from anything that reports.
|
||||
#
|
||||
# Each value is the ID-SPECIFIC half of the refusal: the endpoint, what it was
|
||||
# observed to answer on 2026-09-13, and why no replacement plugin can be built.
|
||||
# validate.py owns the common framing. Verified by hand before deletion, not
|
||||
# taken on report - see DECISIONS/TARIFF-07-withdrawing-three-plugins.md.
|
||||
# --------------------------------------------------------------------------- #
|
||||
RETIRED_PROVIDERS: dict = {
|
||||
"engie_dynamic": (
|
||||
"its endpoint https://api.engie.be/dynamic/be does not exist - the "
|
||||
"gateway there answers 404 with Kong's \"no Route matched with those "
|
||||
"values\". No public endpoint could replace it: ENGIE's dynamic price "
|
||||
"is (B x eSpot_15) - A with PER-CONTRACT coefficients that live behind "
|
||||
"your klantenzone login, so no unauthenticated URL can return YOUR "
|
||||
"price"),
|
||||
"totalenergies_dynamic": (
|
||||
"its endpoint https://api.totalenergies.be/prices/dynamic does not "
|
||||
"exist - the TLS handshake fails outright because that hostname is "
|
||||
"absent from the certificate the server presents. The coefficients are "
|
||||
"per-contract there too"),
|
||||
"eneco_eddy": (
|
||||
"its endpoint https://api.eneco.be/eddy/prices does not exist - it "
|
||||
"answers 404 with an empty body - and \"Eddy\" is not an Eneco "
|
||||
"product at all; their dynamic product is \"Zon & Wind Dynamisch\", "
|
||||
"which is indexed to Belpex/EPEX DAY-AHEAD and whose coefficients are "
|
||||
"likewise per-contract"),
|
||||
}
|
||||
|
||||
|
||||
PROVIDERS: dict = {}
|
||||
|
||||
|
||||
@@ -1095,6 +1169,22 @@ def register(cls):
|
||||
"""
|
||||
if cls.id in PROVIDERS:
|
||||
raise ValueError(f"duplicate provider id {cls.id!r}")
|
||||
if cls.id in RETIRED_PROVIDERS:
|
||||
# ⚠️ AT IMPORT, NOT AT FETCH, and for the same reason the leak check is.
|
||||
# A retired id that is registered again is the one state in which
|
||||
# validate.py's retired-id refusal goes quiet WITHOUT anyone deciding
|
||||
# it should: `pid in PROVIDERS` becomes true, the named message is
|
||||
# never reached, and the operator is back to a provider that looks
|
||||
# like it works. Re-shipping an id is legitimate - the endpoint could
|
||||
# become real - but it is a DECISION, and taking the id out of
|
||||
# RETIRED_PROVIDERS in the same commit is what records it.
|
||||
raise ValueError(
|
||||
f"{cls.id!r} is in RETIRED_PROVIDERS and cannot also be a shipped "
|
||||
f"plugin. A site configured on it is refused at startup with a "
|
||||
f"message naming the id; registering it silently takes that "
|
||||
f"message away. If this id really ships again, remove it from "
|
||||
f"RETIRED_PROVIDERS in the same commit - and say in the CHANGELOG "
|
||||
f"what changed about the endpoint.")
|
||||
cls.capabilities() # fail at import, not at 15:00 on fetch day
|
||||
leaks = code_leaks(cls)
|
||||
if leaks:
|
||||
@@ -1233,7 +1323,7 @@ def check_egress(url: str, caps: ProviderCapabilities) -> str:
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- #
|
||||
# The five shipped plugins.
|
||||
# The shipped plugins.
|
||||
#
|
||||
# ⚠️ EACH DOCSTRING STATES WHICH COMPONENTS IT SOURCES AND WHICH THE FRAMEWORK
|
||||
# ADDS, in the two fixed lines `SOURCES: ...` / `The framework ADDS: ...`. That
|
||||
@@ -1243,49 +1333,22 @@ def check_egress(url: str, caps: ProviderCapabilities) -> str:
|
||||
# what its feed contains is a red check rather than a 3 c/kWh error nobody sees.
|
||||
# --------------------------------------------------------------------------- #
|
||||
|
||||
def _points_from_json(body, price_key, scale, provisional_default):
|
||||
"""Shared parse for the three JSON feeds. Shape differences are the args."""
|
||||
try:
|
||||
text = body.decode("utf-8") if isinstance(body, (bytes, bytearray)) \
|
||||
else str(body)
|
||||
doc = json.loads(text)
|
||||
except (ValueError, UnicodeDecodeError) as e:
|
||||
raise SourceUnavailable(f"the feed did not parse as JSON: {e}")
|
||||
rows = doc.get("data") if isinstance(doc, dict) else doc
|
||||
if not isinstance(rows, list):
|
||||
raise SourceUnavailable("the feed carried no 'data' list")
|
||||
out = []
|
||||
for row in rows:
|
||||
try:
|
||||
start = datetime.fromisoformat(str(row["start"]))
|
||||
value = float(row[price_key]) * scale
|
||||
except (KeyError, TypeError, ValueError) as e:
|
||||
raise SourceUnavailable(f"malformed row {row!r}: {e}")
|
||||
if start.tzinfo is None:
|
||||
raise SourceUnavailable(
|
||||
f"row {row['start']!r} carries no UTC offset; this feed is "
|
||||
f"required to publish absolute instants")
|
||||
out.append(RawPoint(start=start, eur_per_kwh=value,
|
||||
provisional=bool(row.get("provisional",
|
||||
provisional_default))))
|
||||
return out
|
||||
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- #
|
||||
# TARIFF-08: the COLUMNAR document, which is what the public EPEX feed really
|
||||
# publishes.
|
||||
#
|
||||
# ⚠️ THIS IS A SECOND SHAPE, READ BY A SECOND FUNCTION ON PURPOSE.
|
||||
# `_points_from_json()` above reads a row-per-point document: `{"data": [{...},
|
||||
# {...}]}`. `https://api.energy-charts.info/price?bzn=BE` does not publish that
|
||||
# and never did - it publishes PARALLEL ARRAYS:
|
||||
# ⚠️ THIS IS THE ONLY PARSER LEFT, AND THE SHAPE IT DOES **NOT** READ IS WHY.
|
||||
# Until TARIFF-07 a second function, `_points_from_json()`, read a row-per-point
|
||||
# document: `{"data": [{...}, {...}]}`. NO FEED ANYBODY REACHED EVER PUBLISHED
|
||||
# THAT SHAPE - it was invented alongside the three withdrawn plugins, and the
|
||||
# only bodies ever fed to it were the fixtures written from the same guess. It
|
||||
# went with them. `https://api.energy-charts.info/price?bzn=BE` publishes
|
||||
# PARALLEL ARRAYS:
|
||||
#
|
||||
# {"unix_seconds": [1788991200, 1788992100, ...], <- UTC epoch seconds
|
||||
# "price": [216.08, 209.90, ...], <- one per instant
|
||||
# "unit": "EUR / MWh", "license_info": "...", "deprecated": false}
|
||||
#
|
||||
# The shipped parser was pointed at that URL and asked for `doc["data"]`, so
|
||||
# The row parser was pointed at that URL and asked for `doc["data"]`, so
|
||||
# every fetch ended `SourceUnavailable: the feed carried no 'data' list` ->
|
||||
# §11.4 -> static profile, arbitrage off, and nothing in the status page said
|
||||
# why. Verified live 2026-09-10 against both fixtures under `scenarios/`.
|
||||
@@ -1441,7 +1504,8 @@ class GenericDayAhead(PriceProvider):
|
||||
either number, it cannot be the one that adds them twice.
|
||||
|
||||
⚠️ IT READS THE COLUMNAR SHAPE, AND SAYS SO IN ITS OWN `fetch()`. Until
|
||||
TARIFF-08 it called `_points_from_json()` and asked
|
||||
TARIFF-08 it called the row-per-point parser (withdrawn by TARIFF-07) and
|
||||
asked
|
||||
`api.energy-charts.info` for a `"data"` list it has never published, so
|
||||
every fetch this provider ever made ended in `SourceUnavailable` and §11.4
|
||||
turned that into a silent fall back to the static profile. See
|
||||
@@ -1527,101 +1591,6 @@ class GenericDayAhead(PriceProvider):
|
||||
provisional_default=False)
|
||||
|
||||
|
||||
@register
|
||||
class EngieDynamic(PriceProvider):
|
||||
"""Engie's dynamic day-ahead product, published in EUR/kWh.
|
||||
|
||||
SOURCES: energy, markup
|
||||
The framework ADDS: taxes
|
||||
|
||||
⚠️ Engie's published figure ALREADY CONTAINS THEIR MARKUP - it is a retail
|
||||
price, not a wholesale one. Adding `price_markup_eur_kwh` on top of it is
|
||||
the defect this ticket's design exists to make unreachable; the declaration
|
||||
above is what stops it, and nothing here needs to remember the rule.
|
||||
"""
|
||||
|
||||
id = "engie_dynamic"
|
||||
|
||||
@classmethod
|
||||
def capabilities(cls):
|
||||
return ProviderCapabilities(
|
||||
product=PriceProduct.DAY_AHEAD,
|
||||
sources=frozenset({Component.ENERGY, Component.MARKUP}),
|
||||
needs_credentials=True,
|
||||
egress_hosts=("api.engie.be",))
|
||||
|
||||
async def fetch(self, opts, since, until, transport):
|
||||
url = opts.get("price_feed_url") or "https://api.engie.be/dynamic/be"
|
||||
check_egress(url, self.capabilities())
|
||||
body = await transport(url, float(opts.get("price_timeout_s")))
|
||||
return _points_from_json(body, "price_eur_kwh", 1.0, False)
|
||||
|
||||
|
||||
@register
|
||||
class TotalEnergiesDynamic(PriceProvider):
|
||||
"""TotalEnergies' dynamic day-ahead product, published in EUR/kWh.
|
||||
|
||||
SOURCES: energy, markup
|
||||
The framework ADDS: taxes
|
||||
|
||||
Same retail shape as Engie: the supplier's own margin is inside the number.
|
||||
"""
|
||||
|
||||
id = "totalenergies_dynamic"
|
||||
|
||||
@classmethod
|
||||
def capabilities(cls):
|
||||
return ProviderCapabilities(
|
||||
product=PriceProduct.DAY_AHEAD,
|
||||
sources=frozenset({Component.ENERGY, Component.MARKUP}),
|
||||
needs_credentials=True,
|
||||
egress_hosts=("api.totalenergies.be",))
|
||||
|
||||
async def fetch(self, opts, since, until, transport):
|
||||
url = opts.get("price_feed_url") or \
|
||||
"https://api.totalenergies.be/prices/dynamic"
|
||||
check_egress(url, self.capabilities())
|
||||
body = await transport(url, float(opts.get("price_timeout_s")))
|
||||
return _points_from_json(body, "price_eur_kwh", 1.0, False)
|
||||
|
||||
|
||||
@register
|
||||
class EnecoEddy(PriceProvider):
|
||||
"""Eneco Eddy / Eddy Flex - a REAL-TIME / IMBALANCE product, all-in EUR/MWh.
|
||||
|
||||
SOURCES: energy, markup, taxes
|
||||
The framework ADDS: nothing
|
||||
|
||||
⚠️ THE PRODUCT TYPE IS THE INTERESTING FIELD HERE, NOT THE PRICE. §9.2
|
||||
classes Eddy Flex as real-time / imbalance and §8.3 says those get widened
|
||||
arbitrage thresholds. That regime reaches the optimiser through
|
||||
`capabilities().product` -> `_Series.product` -> `volatility_regime()`. If
|
||||
it reached the optimiser through the string "eneco_eddy" instead, then the
|
||||
sixth supplier would need an optimiser edit and AC2 would be dead. This
|
||||
class is the reason the enum exists.
|
||||
|
||||
Imbalance prices are settled after the fact, so the current quarter's figure
|
||||
is genuinely provisional and the feed says so per point.
|
||||
"""
|
||||
|
||||
id = "eneco_eddy"
|
||||
|
||||
@classmethod
|
||||
def capabilities(cls):
|
||||
return ProviderCapabilities(
|
||||
product=PriceProduct.REALTIME,
|
||||
sources=ALL_IN,
|
||||
horizon_h=24,
|
||||
needs_credentials=True,
|
||||
egress_hosts=("api.eneco.be",))
|
||||
|
||||
async def fetch(self, opts, since, until, transport):
|
||||
url = opts.get("price_feed_url") or "https://api.eneco.be/eddy/prices"
|
||||
check_egress(url, self.capabilities())
|
||||
body = await transport(url, float(opts.get("price_timeout_s")))
|
||||
return _points_from_json(body, "price_eur_mwh", 0.001, True)
|
||||
|
||||
|
||||
@register
|
||||
class ManualCsv(PriceProvider):
|
||||
"""A file on disk. AC3: the documented fallback, fully offline.
|
||||
|
||||
@@ -71,12 +71,19 @@ So the flag is not passed through anywhere in this file:
|
||||
the pass-through idiom cannot come back in a later edit and pass review by
|
||||
looking ordinary.
|
||||
|
||||
⚠️ "PUBLISHED" DOES NOT MEAN "FIRM". `eneco_eddy` is an imbalance product whose
|
||||
current-quarter print is genuinely provisional and says so per point (§9.2,
|
||||
TARIFF-02). Such a point is published AND provisional, and the audit's rule for
|
||||
a published point is "the flag is whatever the feed said", never "False". A
|
||||
provenance check that forced published points to False would be a bug that
|
||||
looks like a guarantee.
|
||||
⚠️ "PUBLISHED" DOES NOT MEAN "FIRM". §9.3's canonical format carries
|
||||
`provisional` PER POINT, not per series, precisely because a real-time /
|
||||
imbalance product's current-interval print is settled after the fact and is
|
||||
genuinely provisional while it is published. Such a point is published AND
|
||||
provisional, and the audit's rule for a published point is "the flag is
|
||||
whatever the feed said", never "False". A provenance check that forced
|
||||
published points to False would be a bug that looks like a guarantee.
|
||||
|
||||
⚠️ NO SHIPPED PLUGIN EMITS ONE TODAY (TARIFF-07 withdrew the only declarer of
|
||||
`PriceProduct.REALTIME`), and that is exactly why this paragraph stays. The
|
||||
rule is a property of the FORMAT, not of any supplier; weakening it to
|
||||
"published implies False" while nothing exercises it is how the first real
|
||||
imbalance feed would arrive mispriced and flagged firm.
|
||||
|
||||
|
||||
THE FILL, AND WHY IT KEYS ON THE WALL CLOCK
|
||||
@@ -104,8 +111,9 @@ because an empty series is not constructible on purpose (price.py trap 3).
|
||||
|
||||
⚠️ A SUB-HOURLY FEED IS NOT DECIMATED TO ONE POINT AN HOUR, and the hourly walk
|
||||
below is about WHICH HOURS NEED FILLING - never about what a published hour is
|
||||
allowed to contain. `eneco_eddy` is the Belgian imbalance product and settles
|
||||
per QUARTER, `_validate_raw()` accepts any strictly-increasing spacing, and a
|
||||
allowed to contain. BELGIAN DAY-AHEAD ITSELF SETTLES PER QUARTER since the
|
||||
15-minute MTU took effect on 2025-10-01 - `generic_dayahead` reads 96 points a
|
||||
day, not 24 - `_validate_raw()` accepts any strictly-increasing spacing, and a
|
||||
published hour may therefore hold four points. So EVERY published point inside
|
||||
the window is passed through, in order, and a carried point is added only for a
|
||||
whole hour with NO published coverage at all.
|
||||
@@ -171,7 +179,7 @@ class Provenance(Enum):
|
||||
flag" and "the others".
|
||||
"""
|
||||
PUBLISHED = "published" # the provider printed this hour. Flag: the
|
||||
# feed's own - an imbalance print may be
|
||||
# feed's own - a real-time print may be
|
||||
# published AND provisional (§9.2).
|
||||
CARRIED = "carried" # yesterday's same-wall-clock hour (§8.3).
|
||||
# Flag: ALWAYS True, by construction.
|
||||
|
||||
@@ -107,7 +107,8 @@ THE FOUR RULES THIS FILE IS SHAPED BY
|
||||
|
||||
⚠️ NO VALUE-LEVEL CHECK CAN CATCH THAT, and saying so is more useful than a
|
||||
guarantee that would not hold. A carried point and a published-provisional
|
||||
point (`eneco_eddy`'s current quarter, §9.2) are the same three fields with
|
||||
point (a real-time product's current interval, §9.2) are the same three
|
||||
fields with
|
||||
the same flag; the difference is provenance, and provenance is not in the
|
||||
value. So the mechanism is ORDERING, not validation: `carry()` is the only
|
||||
public entry point, it remembers the argument and returns the fill, and the
|
||||
|
||||
@@ -13,7 +13,7 @@ is an EMS for a minority." The §9.2 product table maps four products onto four
|
||||
EMS behaviours, and TARIFF-02 shipped the machinery for the top two only:
|
||||
|
||||
Dynamic day-ahead hourly EPEX BE + markup full arbitrage
|
||||
Real-time/imbalance e.g. Eneco Eddy Flex arbitrage, wider thresholds
|
||||
Real-time/imbalance no shipped plugin (TARIFF-07) arbitrage, wider thresh.
|
||||
Static day/night two-period tariff TIME-WINDOW SHIFTING <- here
|
||||
Fully fixed single price SELF-CONSUMPTION ONLY <- here
|
||||
|
||||
@@ -1082,7 +1082,8 @@ async def resolve_tariff(opts: dict, since: datetime, until: datetime,
|
||||
|
||||
⚠️ THE FILL IS PER WHOLE HOUR AND ITS COVERAGE IS CONDITIONAL. Every point
|
||||
the provider published inside the window passes through BY IDENTITY - four
|
||||
of them in one hour on a quarter-hourly product like `eneco_eddy` - and a
|
||||
of them in one hour on the quarter-hourly day-ahead feed `generic_dayahead`
|
||||
reads (Belgium's 15-minute MTU, 2025-10-01) - and a
|
||||
carried point is added only for a whole hour the feed did not print at all
|
||||
AND yesterday did. An hour neither source can price is left out, which is
|
||||
§11.4 for that hour: `plan.price_at()` raises rather than answering, and an
|
||||
|
||||
@@ -118,8 +118,14 @@ NOT READY banner already names the problem, (b) does not apply.
|
||||
It is warned about below, not refused.
|
||||
|
||||
7. A price configuration that cannot mean what it says. [(a)]
|
||||
Three cases, all in `_price_problems()`: an unknown `price_provider` id
|
||||
(refused rather than defaulted to 'off', per the §14 warning box);
|
||||
Four cases, all in `_price_problems()`: an unknown `price_provider` id
|
||||
(refused rather than defaulted to 'off', per the §14 warning box); a
|
||||
RETIRED id - one this add-on really did ship and has been accepting ever
|
||||
since, whose plugin never once fetched a price because its endpoint does
|
||||
not exist (TARIFF-07), which is case (a) in its purest form: §11.4's
|
||||
silent fall back to the static profile IS the layer the operator cannot
|
||||
see, and it has been overriding their chosen source since the day they
|
||||
set it;
|
||||
`price_provider` set alongside `price_now_entity`/`price_avg_entity`,
|
||||
which is TWO PRICE SOURCES ON ONE SITE where the Home Assistant pair
|
||||
silently wins; and `manual_csv` with no `price_csv_path`, which turns the
|
||||
@@ -322,7 +328,7 @@ from .inverter import roster_entries
|
||||
from .maintenance import MAINT_OPTION_DEFAULTS
|
||||
from .p1 import is_enabled, validate_meter_options
|
||||
from .peakguard import PEAK_OPTION_DEFAULTS
|
||||
from .price import PRICE_OPTION_DEFAULTS, PROVIDERS
|
||||
from .price import PRICE_OPTION_DEFAULTS, PROVIDERS, RETIRED_PROVIDERS
|
||||
from .static_tariff import ProfileInvalid, parse_static_profile
|
||||
from .watchdog import SIGN_OPTION_DEFAULTS
|
||||
|
||||
@@ -1242,17 +1248,71 @@ def _price_problems(opts: dict) -> list[str]:
|
||||
without a price feed is an add-on that a Belgian fixed-tariff site - a large
|
||||
share of the installed base, per §9.2 - cannot run at all.
|
||||
|
||||
Four refusals and two log lines (TARIFF-03 added one refusal, one parse and
|
||||
two notices), and every refusal is still case (a) from this module's
|
||||
docstring: a source the operator SET being overridden by a layer they cannot
|
||||
see. The additions are `static_profile` alongside the Home Assistant price
|
||||
pair - the same silent-loser shape as provider-plus-pair, and a LIVE one -
|
||||
and a `static_profile` that does not tile the day, which would leave hours
|
||||
with no price at all.
|
||||
Five refusals and two log lines (TARIFF-03 added one refusal, one parse and
|
||||
two notices; TARIFF-07 added the retired-id one), and every refusal is still
|
||||
case (a) from this module's docstring: a source the operator SET being
|
||||
overridden by a layer they cannot see. The additions are `static_profile`
|
||||
alongside the Home Assistant price pair - the same silent-loser shape as
|
||||
provider-plus-pair, and a LIVE one - and a `static_profile` that does not
|
||||
tile the day, which would leave hours with no price at all.
|
||||
|
||||
⚠️ THE RETIRED-ID BRANCH IS NOT A FRIENDLIER SPELLING OF THE UNKNOWN-ID
|
||||
ONE, AND MUST NOT COLLAPSE INTO IT. They answer different questions. An
|
||||
unknown id is a TYPO: the operator meant something else and the fix is to
|
||||
spell it right. A retired id is a CHOICE THE ADD-ON ACCEPTED - it was in
|
||||
the schema, it was in the dropdown, it resolved to a class, and every
|
||||
startup since said nothing. What that operator needs is not "this id is
|
||||
wrong" but "this id has never once returned a price, and here is what your
|
||||
site has actually been running instead" - because §11.4 made the failure
|
||||
silent and NOTHING on their status page has ever distinguished it from a
|
||||
working provider that never finds a cheap hour. The retired branch is
|
||||
therefore FIRST, and it names the id, the endpoint, the observation, the
|
||||
tariff that has really been in force, and the move to make.
|
||||
"""
|
||||
problems: list[str] = []
|
||||
pid = str(opts.get("price_provider", "") or "off").strip() or "off"
|
||||
|
||||
if pid in RETIRED_PROVIDERS:
|
||||
# ⚠️ BEFORE the unknown-id branch, and the order is load-bearing: a
|
||||
# retired id is ALSO not in PROVIDERS, so the generic message would
|
||||
# win on a reordering and the operator would be told they mistyped
|
||||
# something they chose on purpose.
|
||||
# ⚠️ AND THE SECOND SENTENCE CHANGES WITH `static_profile`, because
|
||||
# "you have been on the static profile" is FALSE on a site that never
|
||||
# set one. §11.4 falls back to the static profile; with no profile to
|
||||
# fall back to, the site has had no tariff at all - a worse state, and
|
||||
# one this message must not paper over.
|
||||
been_running = (
|
||||
f"the static day/night tariff in static_profile"
|
||||
if str(opts.get("static_profile", "") or "").strip()
|
||||
else "NOTHING AT ALL - static_profile is empty too, so there was "
|
||||
"no tariff to fall back to either")
|
||||
problems.append(
|
||||
f"price_provider is {pid!r}, which WAS a shipped plugin and has "
|
||||
f"been WITHDRAWN (TARIFF-07). This is not a typo and you did not "
|
||||
f"mistype it - the add-on offered this id, accepted it, and has "
|
||||
f"said nothing at every startup since. "
|
||||
f"⚠️ IT HAS NEVER FETCHED A PRICE, HERE OR ANYWHERE: "
|
||||
f"{RETIRED_PROVIDERS[pid]}. Every fetch it ever made ended in "
|
||||
f"SourceUnavailable, and §11.4 turns that into a SILENT fall back "
|
||||
f"- so what this site has actually been running since the day the "
|
||||
f"id was set is {been_running}. Nothing you could see would have "
|
||||
f"differed from a working provider that simply never found a cheap "
|
||||
f"hour, which is why you are being told now rather than left on "
|
||||
f"it. WHAT TO DO: set price_provider to 'generic_dayahead' for the "
|
||||
f"wholesale EPEX BE day-ahead curve, to which the add-on adds your "
|
||||
f"price_markup_eur_kwh and price_taxes_eur_kwh - that APPROXIMATES "
|
||||
f"a Belgian dynamic tariff and cannot reproduce your supplier's "
|
||||
f"B x spot + A formula, so the level will be off even when the "
|
||||
f"shape is right; or 'manual_csv' to enter all-in prices you "
|
||||
f"compute yourself; or 'off' to run on static_profile "
|
||||
f"deliberately. There is deliberately NO alias to your old "
|
||||
f"supplier: aliasing would need your contract's own two "
|
||||
f"coefficients, which live behind your klantenzone login and are "
|
||||
f"in no public index, so the add-on would have to invent the "
|
||||
f"numbers it prices your battery against.")
|
||||
return problems # nothing below can be judged against a dead id
|
||||
|
||||
if pid != "off" and pid not in PROVIDERS:
|
||||
problems.append(
|
||||
f"price_provider is {pid!r}, which is not a shipped plugin. The "
|
||||
|
||||
Reference in New Issue
Block a user