Skip to content

feat(config): read grid import and feed-in prices from the payload - #9

Merged
jravani merged 2 commits into
jay/enerplanet-integrationfrom
feat/jravani/grid-prices
Nov 1, 2026
Merged

jravani merged 2 commits into
jay/enerplanet-integrationfrom
feat/jravani/grid-prices

Conversation

@jravani

@jravani jravani commented Nov 1, 2026

Copy link
Copy Markdown
Member

Refs #8.

A transformer node can now carry grid_import_price and grid_export_price in EUR/kWh. They set the import and export price of its trade{grid_$k} in EUR/MWh, and a feed-in price also limits export to the transformer rating. A node without them translates exactly as before: 300 EUR/MWh import and an unpaid export sink.

Example, a 400 kVA transformer with "grid_import_price": 0.34, "grid_export_price": 0.079:

"grid_trafo_9": {
  "node": "ntrafo_9",
  "carrier": "electricity",
  "import": {"price": 340, "limit": 0.4},
  "export": {"price": 79, "limit": 0.4}
}

Changes:

  • config/enerplanet-to-meme.json: transformer trade rules, mapping version 1.6.0 (1.5.0 is the PV parasitic efficiency on the base branch).
  • pkg/t1k/mapping_test.go: TestMappingGridPrices covers a node with both prices, the reverse restoring them, and a node without them.
  • docs/mappings/enerplanet-to-meme.md and CHANGELOG.md: the field table and the entry.

Checks:

  • TestMappingGridPrices fails without the mapping change (import.price = 300, want 340; export.price missing) and passes with it.
  • make test-race, go vet and gofmt pass.
  • make golden-update leaves the golden files unchanged: the example payload carries no prices.

When a transformer node carries grid_import_price or
grid_export_price (EUR/kWh), they set the import and export price of
its grid trade (EUR/MWh). A feed-in price also limits export to the
transformer rating. Without the properties the import price stays
300 EUR/MWh and export stays unpaid, so existing payloads translate
unchanged. Mapping version 1.6.0.

Refs #8

@jravani jravani left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Verdict: ready to merge into jay/enerplanet-integration; no blockers.

go test -race ./... passes at 8139d75, and forward and reverse runs on the example with prices added match the PR description.

Non-blocking:

  • suggestion: an explicit import price of 0.30 EUR/kWh is not restored by reverse (config line 178)
  • question: a zero feed-in price caps export at the rating, a missing one does not (config line 181)

Comment thread config/enerplanet-to-meme.json Resolved
Comment thread config/enerplanet-to-meme.json Resolved
Reverse treats 300 EUR/MWh as the absent placeholder, so a payload that
sent grid_import_price 0.3 comes back without it. The forward job is
unaffected.
@jravani
jravani merged commit db5951e into jay/enerplanet-integration Nov 1, 2026
6 checks passed
@jravani
jravani deleted the feat/jravani/grid-prices branch November 1, 2026 18:37
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