Skip to content

feat(planner): plan with the published prices only - #1440

Open
frahlg wants to merge 1 commit into
masterfrom
feat/published-prices-only
Open

frahlg wants to merge 1 commit into
masterfrom
feat/published-prices-only

Conversation

@frahlg

@frahlg frahlg commented Sep 25, 2026

Copy link
Copy Markdown
Member

Closes #1439.

Why

Owner decision: the planner uses the prices that are published. The forecast filled every slot after the last day-ahead price with an hour-of-week climatology at confidence 0.6. It fed invented prices into charging decisions and into the terminal value. #1154 shows the tail even used a different VAT. Published prices always reach 11–35 h ahead, and the nearest hours carry the value.

Change

Core

  • Deleted go/internal/priceforecast: the model, the 6 h refit loop and the <config dir>/seed/prices.csv import. No such file ships.
  • mpc: removed PricePredictor, Service.Price, extendPricesWithForecast and Service.GridTariffOreKwh, which only the forecast used. VATPercent stays for demand charges.
    • The plan ends at the last published price. Horizon (48 h) stays as an upper bound.
    • mpc: replanned now logs prices_until.
  • Removed Confidence from slots, plan actions, diagnostics and the Home Assistant plan and price attributes. With it went the DP's blend toward the horizon mean and the "(predicted)" reason tag.
    • horizonMeans became horizonMeanPrice, since the export mean only fed the blend.
  • Energyplan. The request still requires confidence (deny_unknown_fields → missing field 'confidence' without it), so Core sends a constant 1.
    • Removing it from the worker needs an Energyplan release and a macOS build, for no change in behaviour.
    • Tracked in srcfl/energyplan#41 for the next release made for another reason. FTW's native-solver tests fail loudly if the two drift apart.
  • pricefc/state stays in the config table with a note in migrate(), as with Home Link and Ask why. Nothing reads it, and an older release restores its model from it after a rollback.

Web

  • Plan view: no predicted zone, predicted bars, tooltip badge or "Predicted (ML)" legend.
  • The brief's Forecast field says Published prices · Plan until Sat 24:00. A plan ending at midnight is named by its own day.
  • The chart's default view ends where the prices end, capped at 48 h.
  • The Plan help and the Settings › Planner help say the plan reaches as far as prices are published.
  • Diagnose: the Conf column and dimming are removed.

Behaviour afterwards

  • A replan covers the published prices. Here, at 14:11 with tomorrow's prices out, that was slots=136 … prices_until=2026-09-27T00:00.
  • The terminal SoC value is computed over the published prices.
  • An EV deadline later than the last published price is clamped to the plan's last slot, as before. Before about 13:00, a target for tomorrow morning is met within today's known prices until the replan after publication moves it.

Evidence

  • make test: all 67 Go packages ok.
  • make native-solver-test against the bundled Energyplan 0.4.8 worker passes. Without confidence, every native test failed with missing field 'confidence', which is why Core keeps sending it.
  • npm test with LANG=C: 639/639. A Swedish locale fails update-dialog.test.mjs on master too, because of "8 192".
  • Browser. Local Core on this branch, with elprisetjustnu SE3 prices and a simulated Sungrow:
    • brief: "Published prices | Plan until Sat 24:00";
    • legend without "Predicted";
    • the tooltip has no predicted badge;
    • no JS errors;
    • the chart ends at the last published price.

Not in scope

PV and load forecasting is a different "forecast" and is unchanged: forecast, forecasting, planner.forecast_trust, the PV safety k slider and plan-forecast.js.

Notes

🤖 Generated with Claude Code

https://claude.ai/code/session_01MuerPFZFG88kgu8sWVHeq7

The planner filled every slot after the last published day-ahead price
with an hour-of-week climatology from the priceforecast package, marked
it confidence 0.6 and blended it toward the horizon mean. The owner
decided that only the published prices count: they always reach
11–35 hours ahead, and the nearest hours carry the value.

- Delete go/internal/priceforecast, its refit loop and seed CSV import.
- mpc: remove PricePredictor, Service.Price, extendPricesWithForecast
  and Service.GridTariffOreKwh. The plan ends at the last published
  price; Horizon stays an upper bound. `mpc: replanned` logs
  prices_until.
- Remove Slot/Action.Confidence, the DP's blend toward the mean, the
  "(predicted)" reason tag, and the field in diagnostics and the Home
  Assistant payload. horizonMeans becomes horizonMeanPrice; the export
  mean only fed the blend.
- The Energyplan request still requires `confidence`
  (deny_unknown_fields), so Core sends 1 until the worker drops it
  (srcfl/energyplan#41).
- The pricefc/state config key stays, as with Home Link and Ask why:
  nothing reads it, and an older release after a rollback uses it.
- Web: no predicted zone, bars, badge or legend; the plan brief says
  "Published prices · Plan until Sat 24:00"; the chart's default view
  ends where the prices end; help texts say the plan reaches as far as
  prices are published.

Closes #1439.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MuerPFZFG88kgu8sWVHeq7
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T12:16:51.498738Z 66b7fe7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 66b7fe7d74

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

BatteryW float64 `json:"battery_w"`
GridW float64 `json:"grid_w"`
SoCPct float64 `json:"soc_pct"`
PriceOre float64 `json:"price_ore"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update the MQTT payload documentation after removing confidence

Removing confidence from both schedule payload structs makes the maintained integration guide incorrect: docs/ha-integration.md lines 49–55 still promises confidence in plan_json and describes plan_schedule_json as containing every field. Home Assistant or raw MQTT consumers following that contract will wait for a field that is no longer emitted, so update the documented payload alongside this wire-format change.

AGENTS.md reference: AGENTS.md:L321-L322

Useful? React with 👍 / 👎.

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.

Plan with the published prices only: remove the price forecast

1 participant