Skip to content

Document GOPACS Redispatch attributes, state machine, and runtime behavior - #35

Open
Miggets7 wants to merge 9 commits into
mainfrom
feature/gopacs-redispatch-docs
Open

Document GOPACS Redispatch attributes, state machine, and runtime behavior#35
Miggets7 wants to merge 9 commits into
mainfrom
feature/gopacs-redispatch-docs

Conversation

@Miggets7

@Miggets7 Miggets7 commented May 6, 2026

Copy link
Copy Markdown
Contributor

Description

Documentation-only changes to ems/README.md filling gaps in the Redispatch (Intraday Congestion Management) section. Before this PR, 14 of the 19 redispatch attributes on EmsGOPACSAsset were undocumented and several non-obvious runtime behaviors (state machine, MANDATORY-vs-VOLUNTARY selection, transient-failure handling, mandatory API key, polling floor) were not surfaced. The Redispatch section now matches the level of detail already established by the UFTP section above it.

What was added

  • Sequence diagram — Mermaid diagram of the Operator ↔ OpenRemote (CSP) ↔ GOPACS API ↔ Trading Platform flow, mirroring the UFTP one.
  • Selection rules — per poll, the handler keeps only CONGESTIONMANAGEMENT / ANNOUNCEMENT_OPEN announcements where the contracted EAN appears in some EAN-effectivity category, then prefers MANDATORY over VOLUNTARY.
  • Asset attributes subsection — single grouped table (Configuration / Status / Bid / Workflow / History) listing every redispatch attribute on EmsGOPACSAsset, its type, whether it is read-only, and a one-line purpose. redispatchSuggestedPower and redispatchSuggestedVolume are explicitly marked as not yet populated (pending bid pricing strategy follow-up).
  • State machine — explicit list of redispatchBidStatus values: NONE, PENDING_CONFIRMATION, CONFIRMED.
  • Resilience and polling — ≥5 min poll floor (GOPACS guidance), HTTP/exception failures skip the poll and preserve attributes, only confirmed-empty clears them, handler refuses to start without GOPACS_REDISPATCH_API_KEY (logs SEVERE), toggling redispatchEnabled or changing contractedEAN restarts the handler. Persistent non-200s (e.g. 401 from a bad API key) keep stale announcements visible — operator log strings are documented.
  • History semantics — clarified that every polled announcement is recorded on first sight, and selected announcements get a second, richer entry with effectivity details. Recorded-IDs set is bounded at 10 000 (LRU) so a long-running handler cannot leak memory.
  • Cross-link — Redispatch section now links back to UFTP "Getting Started" prerequisites (account, EAN).

Verification

Documentation only — no executable verification. Each claim was cross-checked against:

  • ems/src/main/java/org/openremote/extension/ems/agent/EmsGOPACSAsset.java (attribute definitions)
  • ems/src/main/java/org/openremote/extension/ems/manager/gopacs/GOPACSRedispatchHandler.java (state machine constants, selection logic, failure handling, polling floor, API-key gate, history recording)
  • ems/src/main/java/org/openremote/extension/ems/manager/EmsOptimisationService.java (lifecycle behaviors triggered by attribute changes)

Checklist

  • 1. Acceptance criteria of the linked issue(s) are met
  • 2. Tests are written and all tests pass — N/A (documentation only)
  • 3. Changes are manually tested by you and the reviewer
  • 4. Documentation is written or updated

Miggets7 added 2 commits May 6, 2026 12:09
…ion rules

Fills the gaps between the redispatch implementation and ems/README.md:
- Adds a Mermaid sequence diagram mirroring the UFTP one
- Adds a 'Selection rules' note (MANDATORY preferred over VOLUNTARY)
- Adds an 'Asset attributes' table covering all 19 redispatch attributes
- Enumerates redispatchBidStatus values (NONE, PENDING_CONFIRMATION, CONFIRMED)
- Adds a 'Resilience and polling' subsection covering the polling floor,
  fetch-failure semantics, mandatory API key, and handler-restart triggers
- Clarifies that announcement history records every polled announcement
  (audit trail) and notes the 10k LRU bound
- Cross-links the prerequisites back to the UFTP Getting Started section
- Clarify that redispatchAnnouncementHistory records announcements
  twice for selections (first-sight without effectivity, then a
  richer entry when selected) so the audit trail does not look
  duplicated to operators.
- Note that the >=5 min poll floor clamps the configured interval,
  not a runtime backoff.
- Spell out that persistent non-200 responses (e.g. 401 from a bad
  API key) keep stale announcements visible indefinitely; point to
  the log strings to grep for.
- Add an example category for redispatchEanEffectivity and tighten
  the redispatchLastPoll description to "completed poll where the
  API responded".
- Note that the diagram's selection-side actions only fire on a new
  selection, not every iteration.
@Miggets7 Miggets7 added the Enhancement Improvement of an existing feature label May 6, 2026
@MartinaeyNL

Copy link
Copy Markdown
Member

Adding this to the internal sprint board

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documentation update to the EMS GOPACS README to fully describe the Redispatch (intraday congestion management) feature, aligning its detail level with the existing UFTP documentation and making runtime behavior and asset attributes explicit for operators and developers.

Changes:

  • Added Redispatch prerequisites cross-linking back to UFTP “Getting Started” and documented the required Redispatch API key/env vars.
  • Added a Redispatch sequence diagram plus explicit selection rules and bid-status state machine descriptions.
  • Documented all Redispatch-related EmsGOPACSAsset attributes (grouped table) and clarified resilience/polling and history semantics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ems/README.md
Comment thread ems/README.md Outdated
Comment thread ems/README.md
Address Copilot review feedback on the redispatch documentation:

- Resilience note now describes all three HTTP-200 conditions that clear
  the active announcement (empty response, no open CONGESTIONMANAGEMENT
  announcements, or contracted EAN absent from effectivity categories),
  instead of only the empty-response case. Clarifies that only a failed
  fetch preserves prior state.
- Replace inaccurate "LRU-evicted" wording with insertion-order/FIFO in
  both the README and the recordedAnnouncementIds code comment; the set
  uses a LinkedHashMap with accessOrder=false.
- Align the sequence diagram announcement state label with the actual
  ANNOUNCEMENT_OPEN constant used by the handler and prose.
@pierrekil

Copy link
Copy Markdown
Member

@igorrutka to approve

wborn and others added 3 commits June 4, 2026 11:08
* Align README redispatch attribute table with new panel grouping

Renames the "Status" group to "Announcement" so it matches the
new "Redispatch — Announcement" panel title in asset-types.json,
and reorders the Bid rows so the operator-editable
redispatchBidPrice is listed before the read-only suggestion
rows, mirroring the in-UI panel order.

* Reorganise EmsGOPACSAsset UI panels by flow

Splits the single "Configuration" panel so contractedEAN (shared)
and redispatchEnabled (redispatch-only) live in their own groups,
relabels the UFTP panel to reflect intraday flex traffic and splits
it into Flex Request / Flex Order, separates Redispatch Bid (price
and suggestions) from Workflow (confirm + status state machine),
and surfaces redispatchAnnouncementHistory / redispatchBidHistory
as an explicit "Redispatch — History" panel. Operator-editable
attributes are placed first within their panel.

Closes openremote/denhaag#162.

* Add notes and column-1 sidebar panels to EmsGOPACSAsset

Mirrors the EmsEnergyOptimisationAsset layout: a hideOnMobile
notes panel at the top of the main column, and the standard
sidebar trio (location, history, linkedUsers) in column 1, so the
GOPACS asset page picks up free-text notes plus the platform's
location, history-timeline and access-management widgets.

* Moved some redispatched panels to column 1
@Miggets7

Copy link
Copy Markdown
Contributor Author

@igorrutka can you please checkout this PR?

@MartinaeyNL
MartinaeyNL removed request for a team and pierrekil June 29, 2026 09:21
@wborn wborn added Documentation Improvements or additions to documentation and removed Enhancement Improvement of an existing feature labels Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants