Skip to content

Added support for EEGs#345

Open
GenFlogi wants to merge 1 commit into
DarwinsBuddy:mainfrom
GenFlogi:feat/energiegemeinschaft-statistics
Open

Added support for EEGs#345
GenFlogi wants to merge 1 commit into
DarwinsBuddy:mainfrom
GenFlogi:feat/energiegemeinschaft-statistics

Conversation

@GenFlogi

@GenFlogi GenFlogi commented May 16, 2026

Copy link
Copy Markdown

Energiegemeinschaft: grid/community consumption split

Adds EEG consumption side support for #310. Supersedes the approach in #343.

What

For Zählpunkte participating in an Energiegemeinschaft (EEG), additionally
import the grid/community consumption split as two new external
statistics
, alongside the existing total:

  • wnsm:<zp> — unchanged (total consumption, V001/V002)
  • wnsm:<zp>_grid — grid draw, role G001 (Restnetzbezug)
  • wnsm:<zp>_eeg — supplied by the community, role G003 (Eigendeckung)

G001 + G003 = V002 (per the role mapping established by @tschoerk and
confirmed by @AndiVienna91 in #310). Users wire _grid/_eeg into the
Energy Dashboard as two grid-consumption sources with separate prices.

Auto-detection, no config flow

Participation is detected via the existing
user/zaehlpunkte/{gp}/{zp}/zaehlwerke endpoint: an eagTeilnahmen entry
with status == "A" whose date range covers today. Detection failures are
swallowed to debug — they can never break a normal update.

Testing

  • Live-validated against a real EEG account: descriptor matched the main
    ZP (no SmartmeterQueryError), three importers ran, _grid/_eeg
    statistics created, G001 + G003 ≈ V002.
  • Only tested with consumption EEG. Sadly don't have access to the flip side
  • Only tested with one EEG and haven't tested leaving one

Scope & honest caveats

  • Consumption only. Feed-in roles (U001 / E002−U001) deferred —
    issue consensus is solid only on G001/G003; W-M-B's feed-in roles are
    ambiguous (U001 vs U01T).
  • OBIS path untouched. find_valid_obis_data is a different
    endpoint/concern; deliberately not modified (minimality).
  • Estimated/late-corrected data. EEG values arrive 2 days–weeks late
    and geschaetzt; the incremental importer won't re-pull revised
    values, so the most recent weeks of _grid/_eeg can differ slightly
    from the WN portal. Pre-existing incremental behaviour, more visible
    for EEG.
  • Leaving an EEG. Detection cuts on dateTo < today; due to WN's
    data lag the final stretch may never import. A dateTo + grace window
    is a possible future refinement.

@GenFlogi
GenFlogi marked this pull request as ready for review May 24, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant